diff options
author | Russ White <russ@riw.us> | 2018-08-04 17:46:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-04 17:46:45 +0200 |
commit | 429a5ad722804d22bcc421235ce70b238e4fec07 (patch) | |
tree | c500aff4cce6ed315d0b4bd7109c1d9f8e65cbbe /pimd | |
parent | Merge pull request #2773 from donaldsharp/pim_ordering (diff) | |
parent | lib: Fix vrf check output to only have 1 line (diff) | |
download | frr-429a5ad722804d22bcc421235ce70b238e4fec07.tar.xz frr-429a5ad722804d22bcc421235ce70b238e4fec07.zip |
Merge pull request #2758 from donaldsharp/pim_join
lib and pim silliness
Diffstat (limited to 'pimd')
-rw-r--r-- | pimd/pim_iface.c | 16 | ||||
-rw-r--r-- | pimd/pim_igmp_join.h | 2 | ||||
-rw-r--r-- | pimd/pim_sock.c | 21 | ||||
-rw-r--r-- | pimd/pim_sock.h | 2 |
4 files changed, 14 insertions, 27 deletions
diff --git a/pimd/pim_iface.c b/pimd/pim_iface.c index e075ff5ac..e79e91d7d 100644 --- a/pimd/pim_iface.c +++ b/pimd/pim_iface.c @@ -46,6 +46,7 @@ #include "pim_rp.h" #include "pim_nht.h" #include "pim_jp_agg.h" +#include "pim_igmp_join.h" static void pim_if_igmp_join_del_all(struct interface *ifp); static int igmp_join_sock(const char *ifname, ifindex_t ifindex, @@ -1194,8 +1195,18 @@ static int igmp_join_sock(const char *ifname, ifindex_t ifindex, return -1; } - if (pim_socket_join_source(join_fd, ifindex, group_addr, source_addr, - ifname)) { + if (pim_igmp_join_source(join_fd, ifindex, group_addr, source_addr)) { + char group_str[INET_ADDRSTRLEN]; + char source_str[INET_ADDRSTRLEN]; + pim_inet4_dump("<grp?>", group_addr, group_str, + sizeof(group_str)); + pim_inet4_dump("<src?>", source_addr, source_str, + sizeof(source_str)); + zlog_warn( + "%s: setsockopt(fd=%d) failure for IGMP group %s source %s ifindex %d on interface %s: errno=%d: %s", + __PRETTY_FUNCTION__, join_fd, group_str, source_str, + ifindex, ifname, errno, safe_strerror(errno)); + close(join_fd); return -2; } @@ -1219,6 +1230,7 @@ static struct igmp_join *igmp_join_new(struct interface *ifp, if (join_fd < 0) { char group_str[INET_ADDRSTRLEN]; char source_str[INET_ADDRSTRLEN]; + pim_inet4_dump("<grp?>", group_addr, group_str, sizeof(group_str)); pim_inet4_dump("<src?>", source_addr, source_str, diff --git a/pimd/pim_igmp_join.h b/pimd/pim_igmp_join.h index abee08006..88385bffb 100644 --- a/pimd/pim_igmp_join.h +++ b/pimd/pim_igmp_join.h @@ -60,8 +60,6 @@ static int pim_igmp_join_source(int fd, ifindex_t ifindex, return setsockopt(fd, SOL_IP, MCAST_JOIN_SOURCE_GROUP, &req, sizeof(req)); - - return 0; } #endif /* PIM_IGMP_JOIN_H */ diff --git a/pimd/pim_sock.c b/pimd/pim_sock.c index 8f311391e..fb0d6b506 100644 --- a/pimd/pim_sock.c +++ b/pimd/pim_sock.c @@ -38,7 +38,6 @@ #include "pim_mroute.h" #include "pim_sock.h" #include "pim_str.h" -#include "pim_igmp_join.h" /* GLOBAL VARS */ @@ -322,26 +321,6 @@ int pim_socket_join(int fd, struct in_addr group, struct in_addr ifaddr, return ret; } -int pim_socket_join_source(int fd, ifindex_t ifindex, struct in_addr group_addr, - struct in_addr source_addr, const char *ifname) -{ - if (pim_igmp_join_source(fd, ifindex, group_addr, source_addr)) { - char group_str[INET_ADDRSTRLEN]; - char source_str[INET_ADDRSTRLEN]; - pim_inet4_dump("<grp?>", group_addr, group_str, - sizeof(group_str)); - pim_inet4_dump("<src?>", source_addr, source_str, - sizeof(source_str)); - zlog_warn( - "%s: setsockopt(fd=%d) failure for IGMP group %s source %s ifindex %d on interface %s: errno=%d: %s", - __PRETTY_FUNCTION__, fd, group_str, source_str, ifindex, - ifname, errno, safe_strerror(errno)); - return -1; - } - - return 0; -} - int pim_socket_recvfromto(int fd, uint8_t *buf, size_t len, struct sockaddr_in *from, socklen_t *fromlen, struct sockaddr_in *to, socklen_t *tolen, diff --git a/pimd/pim_sock.h b/pimd/pim_sock.h index 98db6fecd..08b009932 100644 --- a/pimd/pim_sock.h +++ b/pimd/pim_sock.h @@ -42,8 +42,6 @@ int pim_socket_mcast(int protocol, struct in_addr ifaddr, struct interface *ifp, uint8_t loop); int pim_socket_join(int fd, struct in_addr group, struct in_addr ifaddr, ifindex_t ifindex); -int pim_socket_join_source(int fd, ifindex_t ifindex, struct in_addr group_addr, - struct in_addr source_addr, const char *ifname); int pim_socket_recvfromto(int fd, uint8_t *buf, size_t len, struct sockaddr_in *from, socklen_t *fromlen, struct sockaddr_in *to, socklen_t *tolen, |