]> granicus.if.org Git - libnl/commitdiff
addr: rtnl_addr_set_peer() is limited to IPv4
authorThomas Graf <tgraf@suug.ch>
Sun, 11 Nov 2012 20:01:19 +0000 (21:01 +0100)
committerThomas Graf <tgraf@suug.ch>
Sun, 11 Nov 2012 20:01:19 +0000 (21:01 +0100)
Signed-off-by: Thomas Graf <tgraf@suug.ch>
lib/route/addr.c

index 430fb5477cdf4f00d8e468c7f6e3e411b588eed0..d9c1b5032c9e16a6b08fa3add6c4c098e7595ecb 100644 (file)
@@ -893,6 +893,9 @@ struct nl_addr *rtnl_addr_get_local(struct rtnl_addr *addr)
 
 int rtnl_addr_set_peer(struct rtnl_addr *addr, struct nl_addr *peer)
 {
+       if (peer->a_family != AF_INET)
+               return -NLE_AF_NOSUPPORT;
+
        return __assign_addr(addr, &addr->a_peer, peer, ADDR_ATTR_PEER);
 }