system-linux: set the point to point address if present
authorFelix Fietkau <nbd@openwrt.org>
Sun, 13 May 2012 20:20:52 +0000 (22:20 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Mon, 14 May 2012 19:38:20 +0000 (21:38 +0200)
system-linux.c

index 91b162d2afc2acb1774f7d0cc4ec7f4ab84b1c88..af252ea64e21c68f71ccd8793bcdf4f1731aa0ec 100644 (file)
@@ -857,8 +857,12 @@ static int system_addr(struct device *dev, struct device_addr *addr, int cmd)
 
        nlmsg_append(msg, &ifa, sizeof(ifa), 0);
        nla_put(msg, IFA_LOCAL, alen, &addr->addr);
-       if (v4)
-               nla_put_u32(msg, IFA_BROADCAST, addr->broadcast);
+       if (v4) {
+               if (addr->broadcast)
+                       nla_put_u32(msg, IFA_BROADCAST, addr->broadcast);
+               if (addr->point_to_point)
+                       nla_put_u32(msg, IFA_ADDRESS, addr->point_to_point);
+       }
 
        return system_rtnl_call(msg);
 }