forked from mirrors/nixpkgs
66 lines
1.8 KiB
Diff
66 lines
1.8 KiB
Diff
Description: POC fan driver support
|
|
POC Fan driver support
|
|
Author: Jay Vosburgh <jay.vosburgh@canonical.com>
|
|
|
|
Index: iproute2-4.1.1/include/linux/if_tunnel.h
|
|
===================================================================
|
|
--- iproute2-4.1.1.orig/include/linux/if_tunnel.h
|
|
+++ iproute2-4.1.1/include/linux/if_tunnel.h
|
|
@@ -75,6 +75,9 @@ enum {
|
|
IFLA_IPTUN_ENCAP_SPORT,
|
|
IFLA_IPTUN_ENCAP_DPORT,
|
|
IFLA_IPTUN_COLLECT_METADATA,
|
|
+
|
|
+ IFLA_IPTUN_FAN_UNDERLAY = 32,
|
|
+
|
|
__IFLA_IPTUN_MAX,
|
|
};
|
|
#define IFLA_IPTUN_MAX (__IFLA_IPTUN_MAX - 1)
|
|
Index: iproute2-4.1.1/ip/link_iptnl.c
|
|
===================================================================
|
|
--- iproute2-4.1.1.orig/ip/link_iptnl.c
|
|
+++ iproute2-4.1.1/ip/link_iptnl.c
|
|
@@ -66,6 +66,7 @@ static int iptunnel_parse_opt(struct lin
|
|
__u32 link = 0;
|
|
__u32 laddr = 0;
|
|
__u32 raddr = 0;
|
|
+ __u32 underlay = 0;
|
|
__u8 ttl = 0;
|
|
__u8 tos = 0;
|
|
__u8 pmtudisc = 1;
|
|
@@ -174,6 +175,9 @@ get_failed:
|
|
raddr = get_addr32(*argv);
|
|
else
|
|
raddr = 0;
|
|
+ } else if (strcmp(*argv, "underlay") == 0) {
|
|
+ NEXT_ARG();
|
|
+ underlay = get_addr32(*argv);
|
|
} else if (strcmp(*argv, "local") == 0) {
|
|
NEXT_ARG();
|
|
if (strcmp(*argv, "any"))
|
|
@@ -318,6 +322,9 @@ get_failed:
|
|
}
|
|
}
|
|
|
|
+ if (underlay)
|
|
+ addattr32(n, 1024, IFLA_IPTUN_FAN_UNDERLAY, underlay);
|
|
+
|
|
return 0;
|
|
}
|
|
|
|
@@ -349,6 +356,14 @@ static void iptunnel_print_opt(struct li
|
|
|
|
fprintf(f, "local %s ", local);
|
|
|
|
+ if (tb[IFLA_IPTUN_FAN_UNDERLAY]) {
|
|
+ unsigned addr = rta_getattr_u32(tb[IFLA_IPTUN_FAN_UNDERLAY]);
|
|
+
|
|
+ if (addr)
|
|
+ fprintf(f, "underlay %s ",
|
|
+ format_host_r(AF_INET, 4, &addr, s1, sizeof(s1)));
|
|
+ }
|
|
+
|
|
if (tb[IFLA_IPTUN_LINK] && rta_getattr_u32(tb[IFLA_IPTUN_LINK])) {
|
|
unsigned link = rta_getattr_u32(tb[IFLA_IPTUN_LINK]);
|
|
const char *n = if_indextoname(link, s2);
|