Deleted Added
full compact
l2_packet_privsep.c (214501) l2_packet_privsep.c (252190)
1/*
2 * WPA Supplicant - Layer2 packet handling with privilege separation
3 * Copyright (c) 2007, Jouni Malinen <j@w1.fi>
4 *
1/*
2 * WPA Supplicant - Layer2 packet handling with privilege separation
3 * Copyright (c) 2007, Jouni Malinen <j@w1.fi>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * Alternatively, this software may be distributed under the terms of BSD
10 * license.
11 *
12 * See README and COPYING for more details.
5 * This software may be distributed under the terms of the BSD license.
6 * See README for more details.
13 */
14
15#include "includes.h"
16#include <sys/un.h>
17
18#include "common.h"
19#include "eloop.h"
20#include "l2_packet.h"

--- 153 unchanged lines hidden (view full) ---

174 os_free(l2);
175 return NULL;
176 }
177
178 os_memset(&addr, 0, sizeof(addr));
179 addr.sun_family = AF_UNIX;
180 os_strlcpy(addr.sun_path, l2->own_socket_path, sizeof(addr.sun_path));
181 if (bind(l2->fd, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
7 */
8
9#include "includes.h"
10#include <sys/un.h>
11
12#include "common.h"
13#include "eloop.h"
14#include "l2_packet.h"

--- 153 unchanged lines hidden (view full) ---

168 os_free(l2);
169 return NULL;
170 }
171
172 os_memset(&addr, 0, sizeof(addr));
173 addr.sun_family = AF_UNIX;
174 os_strlcpy(addr.sun_path, l2->own_socket_path, sizeof(addr.sun_path));
175 if (bind(l2->fd, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
182 perror("bind(PF_UNIX)");
176 perror("l2-pkt-privsep: bind(PF_UNIX)");
183 goto fail;
184 }
185
186 reg_cmd[0] = protocol;
187 reg_cmd[1] = l2_hdr;
188 if (wpa_priv_cmd(l2, PRIVSEP_CMD_L2_REGISTER, reg_cmd, sizeof(reg_cmd))
189 < 0) {
190 wpa_printf(MSG_ERROR, "L2: Failed to register with wpa_priv");

--- 77 unchanged lines hidden ---
177 goto fail;
178 }
179
180 reg_cmd[0] = protocol;
181 reg_cmd[1] = l2_hdr;
182 if (wpa_priv_cmd(l2, PRIVSEP_CMD_L2_REGISTER, reg_cmd, sizeof(reg_cmd))
183 < 0) {
184 wpa_printf(MSG_ERROR, "L2: Failed to register with wpa_priv");

--- 77 unchanged lines hidden ---