diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2008-05-15 15:07:49 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2008-05-15 15:07:49 -0700 |
commit | 1d909aa44b4738214d5b0b846d591e3c7bd044ae (patch) | |
tree | 3d41d043610442934edb179168ca5ff59f357ee2 | |
parent | d798c27bfa776ac437b33981e66aecc1485df12d (diff) | |
parent | ebde268b05fe09bf50e20cb4261c555dce145ee1 (diff) | |
download | quagga-1d909aa44b4738214d5b0b846d591e3c7bd044ae.tar.bz2 quagga-1d909aa44b4738214d5b0b846d591e3c7bd044ae.tar.xz |
Merge branch 'hollywood' of suva.vyatta.com:/git/vyatta-quagga into hollywood
-rw-r--r-- | .gitignore | 1 | ||||
l--------- | ChangeLog | 1 | ||||
-rwxr-xr-x | debian/autogen.sh | 26 | ||||
-rw-r--r-- | zebra/rt_netlink.c | 60 | ||||
-rw-r--r-- | zebra/zebra_rib.c | 3 |
5 files changed, 35 insertions, 56 deletions
@@ -3,7 +3,6 @@ *.l[ao] .deps .libs -ChangeLog INSTALL Makefile Makefile.in diff --git a/ChangeLog b/ChangeLog new file mode 120000 index 00000000..d526672c --- /dev/null +++ b/ChangeLog @@ -0,0 +1 @@ +debian/changelog
\ No newline at end of file diff --git a/debian/autogen.sh b/debian/autogen.sh index ff125d1d..e8c94af8 100755 --- a/debian/autogen.sh +++ b/debian/autogen.sh @@ -1,32 +1,6 @@ #!/bin/sh -if [ -d .git ] ; then -# generate GNU/Debian format ChangeLog from git log - - rm -f ChangeLog - - if which git2cl >/dev/null ; then - git-log --pretty --numstat --summary | git2cl >> ChangeLog - else - git-log --pretty=short >> ChangeLog - fi - -# append repository reference - - url=` git repo-config --get remote.origin.url` - test "x$url" = "x" && url=`pwd` - - branch=`git-branch --no-color | sed '/^\* /!d; s/^\* //'` - test "x$branch" = "x" && branch=master - - sha=`git log --pretty=oneline --no-color -n 1 | cut -c-8` - test "x$sha" = "x" && sha=00000000 - - echo "$url#$branch-$sha" >> ChangeLog - -fi - rm -rf config rm -f aclocal.m4 config.guess config.statusconfig.sub configure INSTALL diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c index b794f18a..4b9daef4 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@ -287,7 +287,7 @@ netlink_request (int family, int type, struct nlsock *nl) req.nlh.nlmsg_len = sizeof req; req.nlh.nlmsg_type = type; req.nlh.nlmsg_flags = NLM_F_ROOT | NLM_F_MATCH | NLM_F_REQUEST; - req.nlh.nlmsg_pid = 0; + req.nlh.nlmsg_pid = nl->snl.nl_pid; req.nlh.nlmsg_seq = ++nl->seq; req.g.rtgen_family = family; @@ -370,13 +370,6 @@ netlink_parse_info (int (*filter) (struct sockaddr_nl *, struct nlmsghdr *), return -1; } - /* JF: Ignore messages that aren't from the kernel */ - if ( snl.nl_pid != 0 ) - { - zlog ( NULL, LOG_ERR, "Ignoring message from pid %u", snl.nl_pid ); - continue; - } - for (h = (struct nlmsghdr *) buf; NLMSG_OK (h, (unsigned int) status); h = NLMSG_NEXT (h, status)) { @@ -1015,7 +1008,7 @@ netlink_link_change (struct sockaddr_nl *snl, struct nlmsghdr *h) /* Add interface. */ if (h->nlmsg_type == RTM_NEWLINK) { - unsigned long flag = ifi->ifi_flags & 0x0000fffff; + unsigned long new_flags = ifi->ifi_flags & 0x0000fffff; ifp = if_lookup_by_name (name); if (ifp == NULL || !CHECK_FLAG (ifp->status, ZEBRA_INTERFACE_ACTIVE)) @@ -1024,10 +1017,10 @@ netlink_link_change (struct sockaddr_nl *snl, struct nlmsghdr *h) ifp = if_get_by_name (name); zlog_info ("interface %s index %d %s added.", - name, ifi->ifi_index, if_flag_dump(flag)); + name, ifi->ifi_index, if_flag_dump(new_flags)); set_ifindex(ifp, ifi->ifi_index); - ifp->flags = flag; + ifp->flags = new_flags; ifp->mtu6 = ifp->mtu = *(int *) RTA_DATA (tb[IFLA_MTU]); ifp->metric = 1; @@ -1041,28 +1034,32 @@ netlink_link_change (struct sockaddr_nl *snl, struct nlmsghdr *h) ifp->mtu6 = ifp->mtu = *(int *) RTA_DATA (tb[IFLA_MTU]); ifp->metric = 1; - zlog_info ("interface %s index %d changed %s.", - name, ifi->ifi_index, if_flag_dump(flag)); - if (if_is_operative (ifp)) - { - ifp->flags = flag; - if (!if_is_operative (ifp)) - if_down (ifp); + if (new_flags != ifp->flags) + { + zlog_info ("interface %s index %d changed %s.", + name, ifi->ifi_index, if_flag_dump(new_flags)); + + if (if_is_operative (ifp)) + { + ifp->flags = new_flags; + if (!if_is_operative (ifp)) + if_down (ifp); + else + /* Must notify client daemons of new interface status. */ + zebra_interface_up_update (ifp); + } else - /* Must notify client daemons of new interface status. */ - zebra_interface_up_update (ifp); - } - else - { - ifp->flags = ifi->ifi_flags & 0x0000fffff; - if (if_is_operative (ifp)) - if_up (ifp); - } + { + ifp->flags = new_flags; + if (if_is_operative (ifp)) + if_up (ifp); + } + } } } else { - // RTM_DELLINK. + // RTM_DELLINK. ifp = if_lookup_by_name (name); if (ifp == NULL) @@ -1083,6 +1080,13 @@ netlink_link_change (struct sockaddr_nl *snl, struct nlmsghdr *h) int netlink_information_fetch (struct sockaddr_nl *snl, struct nlmsghdr *h) { + /* JF: Ignore messages that aren't from the kernel */ + if ( snl->nl_pid != 0 ) + { + zlog ( NULL, LOG_ERR, "Ignoring message from pid %u", snl->nl_pid ); + return 0; + } + switch (h->nlmsg_type) { case RTM_NEWROUTE: diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index 24975f71..5ae556bf 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -411,7 +411,8 @@ nexthop_active_ipv4 (struct rib *rib, struct nexthop *nexthop, int set, } return 1; } - else if (CHECK_FLAG (rib->flags, ZEBRA_FLAG_INTERNAL)) + else if (CHECK_FLAG (rib->flags, ZEBRA_FLAG_INTERNAL) || + match->type == ZEBRA_ROUTE_STATIC) { for (newhop = match->nexthop; newhop; newhop = newhop->next) if (CHECK_FLAG (newhop->flags, NEXTHOP_FLAG_FIB) |