X-Git-Url: http://git.archive.openwrt.org/?a=blobdiff_plain;ds=sidebyside;f=system-linux.c;h=6dc9acd82db704573a54a4ca53cd43ee722e7a1b;hb=3653d721dad44c5a63790a3fd67e819dfb1dc428;hp=a6734a4bed7b39a8680f521d7ae850dc2398a3c6;hpb=8b468ec5022834d04b6be1cf45b4fe4f092c692e;p=project%2Fnetifd.git diff --git a/system-linux.c b/system-linux.c index a6734a4..6dc9acd 100644 --- a/system-linux.c +++ b/system-linux.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -47,6 +48,15 @@ #define RT_TABLE_PRELOCAL 128 #endif +#ifndef IFA_F_NOPREFIXROUTE +#define IFA_F_NOPREFIXROUTE 0x200 +#endif + +#ifndef IFA_FLAGS +#define IFA_FLAGS (IFA_MULTICAST + 1) +#endif + + #include #include #include @@ -781,6 +791,7 @@ sec_to_jiffies(int val) int system_bridge_addbr(struct device *bridge, struct bridge_config *cfg) { + char buf[64]; unsigned long args[4] = {}; if (ioctl(sock_ioctl, SIOCBRADDBR, bridge->ifname) < 0) @@ -800,6 +811,10 @@ int system_bridge_addbr(struct device *bridge, struct bridge_config *cfg) system_set_dev_sysctl("/sys/devices/virtual/net/%s/bridge/multicast_querier", bridge->ifname, cfg->multicast_querier ? "1" : "0"); + snprintf(buf, sizeof(buf), "%i", cfg->hash_max); + system_set_dev_sysctl("/sys/devices/virtual/net/%s/bridge/hash_max", + bridge->ifname, buf); + args[0] = BRCTL_SET_BRIDGE_PRIORITY; args[1] = cfg->priority; system_bridge_if(bridge->ifname, NULL, SIOCDEVPRIVATE, &args); @@ -1469,6 +1484,9 @@ static int system_addr(struct device *dev, struct device_addr *addr, int cmd) } nla_put(msg, IFA_CACHEINFO, sizeof(cinfo), &cinfo); + + if (cmd == RTM_NEWADDR && (addr->flags & DEVADDR_OFFLINK)) + nla_put_u32(msg, IFA_FLAGS, IFA_F_NOPREFIXROUTE); } return system_rtnl_call(msg);