X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fnetifd.git;a=blobdiff_plain;f=system-linux.c;h=08b675728244a44923bd7b7221e6de15183b39b8;hp=7a443adeb183736588d1fe2b25998650c0f63e42;hb=f4f4f0b8d905231655b2a6fa20af4cc8b092d91e;hpb=20510bd45d70c5b07718e7608d82133883346673 diff --git a/system-linux.c b/system-linux.c index 7a443ad..08b6757 100644 --- a/system-linux.c +++ b/system-linux.c @@ -47,6 +47,10 @@ #define RT_TABLE_PRELOCAL 128 #endif +#ifndef IFA_F_NOPREFIXROUTE +#define IFA_F_NOPREFIXROUTE 0x200 +#endif + #include #include #include @@ -374,7 +378,6 @@ static int system_get_neigh6reachabletime(struct device *dev, char *buf, const s static int cb_rtnl_event(struct nl_msg *msg, void *arg) { struct nlmsghdr *nh = nlmsg_hdr(msg); - struct ifinfomsg *ifi = NLMSG_DATA(nh); struct nlattr *nla[__IFLA_MAX]; int link_state = 0; char buf[10]; @@ -382,7 +385,7 @@ static int cb_rtnl_event(struct nl_msg *msg, void *arg) if (nh->nlmsg_type != RTM_NEWLINK) goto out; - nlmsg_parse(nh, sizeof(*ifi), nla, __IFLA_MAX - 1, NULL); + nlmsg_parse(nh, sizeof(struct ifinfomsg), nla, __IFLA_MAX - 1, NULL); if (!nla[IFLA_IFNAME]) goto out; @@ -799,7 +802,7 @@ int system_bridge_addbr(struct device *bridge, struct bridge_config *cfg) bridge->ifname, cfg->igmp_snoop ? "1" : "0"); system_set_dev_sysctl("/sys/devices/virtual/net/%s/bridge/multicast_querier", - bridge->ifname, cfg->igmp_snoop ? "1" : "0"); + bridge->ifname, cfg->multicast_querier ? "1" : "0"); args[0] = BRCTL_SET_BRIDGE_PRIORITY; args[1] = cfg->priority; @@ -1428,6 +1431,7 @@ static int system_addr(struct device *dev, struct device_addr *addr, int cmd) .ifa_family = (alen == 4) ? AF_INET : AF_INET6, .ifa_prefixlen = addr->mask, .ifa_index = dev->ifindex, + .ifa_flags = (addr->flags & DEVADDR_OFFLINK) ? IFA_F_NOPREFIXROUTE : 0, }; struct nl_msg *msg;