projects
/
project
/
mdnsd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix potential buffer overflow when txt records are forged
[project/mdnsd.git]
/
interface.c
diff --git
a/interface.c
b/interface.c
index
bcd6f13
..
2ed1d05
100644
(file)
--- a/
interface.c
+++ b/
interface.c
@@
-18,7
+18,6
@@
#include <sys/stat.h>
#include <sys/utsname.h>
#include <net/if.h>
#include <sys/stat.h>
#include <sys/utsname.h>
#include <net/if.h>
-#include <linux/sockios.h>
#include <arpa/inet.h>
#include <stdlib.h>
#include <arpa/inet.h>
#include <stdlib.h>
@@
-40,10
+39,7
@@
int
interface_send_packet(struct interface *iface, struct iovec *iov, int iov_len)
{
static size_t cmsg_data[( CMSG_SPACE(sizeof(struct in_pktinfo)) / sizeof(size_t)) + 1];
interface_send_packet(struct interface *iface, struct iovec *iov, int iov_len)
{
static size_t cmsg_data[( CMSG_SPACE(sizeof(struct in_pktinfo)) / sizeof(size_t)) + 1];
- static struct sockaddr_in a = {
- .sin_family = AF_INET,
- .sin_port = htons(MCAST_PORT),
- };
+ static struct sockaddr_in a;
static struct msghdr m = {
.msg_name = (struct sockaddr *) &a,
.msg_namelen = sizeof(a),
static struct msghdr m = {
.msg_name = (struct sockaddr *) &a,
.msg_namelen = sizeof(a),
@@
-54,6
+50,8
@@
interface_send_packet(struct interface *iface, struct iovec *iov, int iov_len)
struct cmsghdr *cmsg;
int fd = iface->fd.fd;
struct cmsghdr *cmsg;
int fd = iface->fd.fd;
+ a.sin_family = AF_INET;
+ a.sin_port = htons(MCAST_PORT);
m.msg_iov = iov;
m.msg_iovlen = iov_len;
m.msg_iov = iov;
m.msg_iovlen = iov_len;