summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Härdeman <david@hardeman.nu>2020-06-16 23:21:53 +0200
committerDavid Härdeman <david@hardeman.nu>2020-06-16 23:21:53 +0200
commite74dad8526cc72ced4554f9af16464a00b230eec (patch)
tree0608f829a39fed1136090483a6c01cbdcb806f10
parent5267074938565976b105324ded8a8c5982bb8d5a (diff)
Some minor fixes to igmp
-rw-r--r--igmp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/igmp.c b/igmp.c
index 14ba516..784ed2f 100644
--- a/igmp.c
+++ b/igmp.c
@@ -501,10 +501,10 @@ igmp_init(struct cfg *cfg)
*/
sfd = socket(AF_PACKET, SOCK_DGRAM | SOCK_CLOEXEC, htons(ETH_P_ALL));
if (sfd < 0) {
- if (errno == EACCES)
- verbose("igmp socket: permission denied\n");
+ if (errno == EACCES || errno == EPERM)
+ verbose("permission denied\n");
else
- error("igmp socket: %m");
+ error("socket: %m (%i)\n", errno);
goto out_free;
}
@@ -543,7 +543,7 @@ igmp_init(struct cfg *cfg)
/* can't set .sll_protocol to htons(ETH_P_IP), see comment above */
if (bind(sfd, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
- error("bind: %m");
+ error("bind: %m\n");
goto out_fd;
}