From 5c1d3fc93d91384bbac29adf01074fa4375317ea Mon Sep 17 00:00:00 2001 From: Umut Tezduyar Lindskog Date: Fri, 28 Feb 2014 16:10:20 +0100 Subject: sd-network: IPv4 link-local support [v2] Implements IPv4LL with respect to RFC 3927 (http://tools.ietf.org/rfc/rfc3927.txt) and integrates it with networkd. Majority of the IPv4LL state machine is taken from avahi (http://avahi.org/) project's autoip. IPv4LL can be enabled by IPv4LL=yes under [Network] section of .network file. IPv4LL works independent of DHCP but if DHCP lease is aquired, then LL address will be dropped. [tomegun: removed a trailing newline and a compiler warning] --- src/libsystemd/sd-rtnl/rtnl-message.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/libsystemd/sd-rtnl') diff --git a/src/libsystemd/sd-rtnl/rtnl-message.c b/src/libsystemd/sd-rtnl/rtnl-message.c index 27b606593b..95dccc2f81 100644 --- a/src/libsystemd/sd-rtnl/rtnl-message.c +++ b/src/libsystemd/sd-rtnl/rtnl-message.c @@ -85,6 +85,20 @@ int sd_rtnl_message_route_set_dst_prefixlen(sd_rtnl_message *m, unsigned char pr return 0; } +int sd_rtnl_message_route_set_scope(sd_rtnl_message *m, unsigned char scope) { + struct rtmsg *rtm; + + assert_return(m, -EINVAL); + assert_return(m->hdr, -EINVAL); + assert_return(rtnl_message_type_is_route(m->hdr->nlmsg_type), -EINVAL); + + rtm = NLMSG_DATA(m->hdr); + + rtm->rtm_scope = scope; + + return 0; +} + int sd_rtnl_message_new_route(sd_rtnl *rtnl, sd_rtnl_message **ret, uint16_t nlmsg_type, unsigned char rtm_family) { struct rtmsg *rtm; -- cgit v1.2.3-54-g00ecf