Skip to content

Commit

Permalink
* rt_netlink.c (netlink_talk_filter): Show always warning message,
Browse files Browse the repository at this point in the history
	  it's not for debug.
	* rt_netlink.c (netlink_talk): Don't assume we use netlink_cmd
	  although we do now actually.
	* rt_netlink.c (netlink_route, netlink_route_multipath): Always use
	  netlink_cmd to send messages to the kernel.

	[backport candidate]
  • Loading branch information
hasso committed Mar 31, 2005
1 parent aca72fd commit b7ed1ec
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
9 changes: 9 additions & 0 deletions zebra/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
2005-03-31 Hasso Tepper <hasso at quagga.net>

* rt_netlink.c (netlink_talk_filter): Show always warning message,
it's not for debug.
* rt_netlink.c (netlink_talk): Don't assume we use netlink_cmd
although we do now actually.
* rt_netlink.c (netlink_route, netlink_route_multipath): Always use
netlink_cmd to send messages to the kernel.

2005-03-30 Andrew J. Schorr <[email protected]>

* irdp.h: Add prototype for irdp_sock_init, and fix protos for
Expand Down
17 changes: 5 additions & 12 deletions zebra/rt_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -1221,8 +1221,7 @@ addattr32 (struct nlmsghdr *n, int maxlen, int type, int data)
static int
netlink_talk_filter (struct sockaddr_nl *snl, struct nlmsghdr *h)
{
if (IS_ZEBRA_DEBUG_KERNEL)
zlog_debug ("netlink_talk: ignoring message type 0x%04x", h->nlmsg_type);
zlog_warn ("netlink_talk: ignoring message type 0x%04x", h->nlmsg_type);
return 0;
}

Expand All @@ -1241,13 +1240,13 @@ netlink_talk (struct nlmsghdr *n, struct nlsock *nl)
memset (&snl, 0, sizeof snl);
snl.nl_family = AF_NETLINK;

n->nlmsg_seq = ++netlink_cmd.seq;
n->nlmsg_seq = ++nl->seq;

/* Request an acknowledgement by setting NLM_F_ACK */
n->nlmsg_flags |= NLM_F_ACK;

if (IS_ZEBRA_DEBUG_KERNEL)
zlog_debug ("netlink_talk: %s type %s(%u), seq=%u", netlink_cmd.name,
zlog_debug ("netlink_talk: %s type %s(%u), seq=%u", nl->name,
lookup (nlmsg_str, n->nlmsg_type), n->nlmsg_type,
n->nlmsg_seq);

Expand Down Expand Up @@ -1357,7 +1356,7 @@ netlink_route (int cmd, int family, void *dest, int length, void *gate,
snl.nl_family = AF_NETLINK;

/* Talk to netlink socket. */
ret = netlink_talk (&req.n, &netlink);
ret = netlink_talk (&req.n, &netlink_cmd);
if (ret < 0)
return -1;

Expand All @@ -1373,7 +1372,6 @@ netlink_route_multipath (int cmd, struct prefix *p, struct rib *rib,
struct sockaddr_nl snl;
struct nexthop *nexthop = NULL;
int nexthop_num = 0;
struct nlsock *nl;
int discard;

struct
Expand Down Expand Up @@ -1639,13 +1637,8 @@ netlink_route_multipath (int cmd, struct prefix *p, struct rib *rib,
memset (&snl, 0, sizeof snl);
snl.nl_family = AF_NETLINK;

if (family == AF_INET)
nl = &netlink_cmd;
else
nl = &netlink;

/* Talk to netlink socket. */
return netlink_talk (&req.n, nl);
return netlink_talk (&req.n, &netlink_cmd);
}

int
Expand Down

0 comments on commit b7ed1ec

Please sign in to comment.