mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-28 16:42:09 +00:00
7615d6385a
iproute now packages a bash-completion file which it installs to $BASH_COMPDIR. * fanpatch: adjust for new version - The patch did not apply because the code around the additions changed. - The patch uses functions that got changed [1] & [2], I adjusted the patch to use the safe version. Probably not needed but better safe than sorry. [1] format_host: http://git.kernel.org/cgit/linux/kernel/git/shemminger/iproute2.git/commit/?id=a418e451643e77fe36861e53359587ba8aa41873 [2] rt_addr_n2a: http://git.kernel.org/cgit/linux/kernel/git/shemminger/iproute2.git/commit/?id=7faf1588a755edb9c9cabbe1d3211265e9826d28
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
|
|
@@ -57,6 +57,9 @@ enum {
|
|
IFLA_IPTUN_ENCAP_FLAGS,
|
|
IFLA_IPTUN_ENCAP_SPORT,
|
|
IFLA_IPTUN_ENCAP_DPORT,
|
|
+
|
|
+ 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);
|