summaryrefslogtreecommitdiff
path: root/accel-pppd/ctrl/l2tp
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2014-11-22 08:56:40 +0300
committerDmitry Kozlov <xeb@mail.ru>2014-11-22 08:56:40 +0300
commit81ca3923a29ea9b67f7291be23b210019546aa5f (patch)
treefcebf0d426665b4f06e01168f27cd8f9ab8c50d8 /accel-pppd/ctrl/l2tp
parent830c399cf126f6bf1e8dfa1ad919a3ce8e346c5d (diff)
downloadaccel-ppp-81ca3923a29ea9b67f7291be23b210019546aa5f.tar.gz
accel-ppp-81ca3923a29ea9b67f7291be23b210019546aa5f.zip
remove trailing whitespaces
Diffstat (limited to 'accel-pppd/ctrl/l2tp')
-rw-r--r--accel-pppd/ctrl/l2tp/dict.c12
-rw-r--r--accel-pppd/ctrl/l2tp/l2tp.c4
-rw-r--r--accel-pppd/ctrl/l2tp/netlink.c14
-rw-r--r--accel-pppd/ctrl/l2tp/packet.c8
4 files changed, 19 insertions, 19 deletions
diff --git a/accel-pppd/ctrl/l2tp/dict.c b/accel-pppd/ctrl/l2tp/dict.c
index f145449..b636c87 100644
--- a/accel-pppd/ctrl/l2tp/dict.c
+++ b/accel-pppd/ctrl/l2tp/dict.c
@@ -70,7 +70,7 @@ const struct l2tp_dict_value_t *l2tp_dict_find_value(const struct l2tp_dict_attr
static char *skip_word(char *ptr)
{
for(; *ptr; ptr++)
- if (*ptr == ' ' || *ptr == '\t' || *ptr == '\n')
+ if (*ptr == ' ' || *ptr == '\t' || *ptr == '\n')
break;
return ptr;
}
@@ -91,9 +91,9 @@ static int split(char *buf, char **ptr)
buf = skip_word(buf);
if (!*buf)
return i;
-
+
*buf = 0;
-
+
buf = skip_space(buf + 1);
if (!*buf)
return i;
@@ -153,12 +153,12 @@ static int dict_load(const char *fname)
} else if (!strcmp(buf, "ATTRIBUTE")) {
if (r < 3)
goto out_syntax;
-
+
attr = malloc(sizeof(*attr));
memset(attr, 0, sizeof(*attr));
list_add_tail(&attr->entry, items);
INIT_LIST_HEAD(&attr->values);
-
+
attr->name = strdup(ptr[0]);
attr->id = strtol(ptr[1], &endptr, 10);
if (*endptr != 0)
@@ -197,7 +197,7 @@ static int dict_load(const char *fname)
} else if (!strcmp(buf, "VALUE")) {
if (r != 3)
goto out_syntax;
-
+
attr = l2tp_dict_find_attr_by_name(ptr[0]);
if (!attr) {
log_emerg("l2tp:%s:%i: attribute not found\n", fname, n);
diff --git a/accel-pppd/ctrl/l2tp/l2tp.c b/accel-pppd/ctrl/l2tp/l2tp.c
index 2a52d69..befe0c9 100644
--- a/accel-pppd/ctrl/l2tp/l2tp.c
+++ b/accel-pppd/ctrl/l2tp/l2tp.c
@@ -4552,7 +4552,7 @@ static int start_udp_server(void)
err_hnd:
triton_md_unregister_handler(&udp_serv.hnd, 1);
triton_context_unregister(&udp_serv.ctx);
-
+
return -1;
err_fd:
@@ -4888,7 +4888,7 @@ static void load_config(void)
opt = conf_get_opt("l2tp", "dir300_quirk");
if (opt)
conf_dir300_quirk = atoi(opt);
-
+
conf_mppe = MPPE_UNSET;
opt = conf_get_opt("l2tp", "mppe");
if (opt) {
diff --git a/accel-pppd/ctrl/l2tp/netlink.c b/accel-pppd/ctrl/l2tp/netlink.c
index c8dce89..3de6e06 100644
--- a/accel-pppd/ctrl/l2tp/netlink.c
+++ b/accel-pppd/ctrl/l2tp/netlink.c
@@ -11,7 +11,7 @@ void l2tp_nl_delete_tunnel(int tid)
{
struct nl_sock *nl_sock;
struct nl_msg *msg;
-
+
nl_sock = nl_socket_alloc();
msg = nlmsg_alloc();
@@ -32,10 +32,10 @@ void l2tp_nl_create_tunnel(int fd, int tid, int peer_tid)
{
struct nl_sock *nl_sock;
struct nl_msg *msg;
-
+
nl_sock = nl_socket_alloc();
msg = nlmsg_alloc();
-
+
genl_connect(nl_sock);
genlmsg_put(msg, NL_AUTO_PID, NL_AUTO_SEQ, family, 0, NLM_F_REQUEST, L2TP_CMD_TUNNEL_CREATE, L2TP_GENL_VERSION);
@@ -58,10 +58,10 @@ void l2tp_nl_create_session(int tid, int sid, int peer_sid)
{
struct nl_sock *nl_sock;
struct nl_msg *msg;
-
+
nl_sock = nl_socket_alloc();
msg = nlmsg_alloc();
-
+
genl_connect(nl_sock);
genlmsg_put(msg, NL_AUTO_PID, NL_AUTO_SEQ, family, 0, NLM_F_REQUEST, L2TP_CMD_SESSION_CREATE, L2TP_GENL_VERSION);
@@ -83,11 +83,11 @@ void l2tp_nl_create_session(int tid, int sid, int peer_sid)
static void init(void)
{
struct nl_sock *nl_sock = nl_socket_alloc();
-
+
genl_connect(nl_sock);
family = genl_ctrl_resolve(nl_sock, L2TP_GENL_NAME);
-
+
nl_close(nl_sock);
nl_socket_free(nl_sock);
}
diff --git a/accel-pppd/ctrl/l2tp/packet.c b/accel-pppd/ctrl/l2tp/packet.c
index 78e0789..34e4bb6 100644
--- a/accel-pppd/ctrl/l2tp/packet.c
+++ b/accel-pppd/ctrl/l2tp/packet.c
@@ -69,7 +69,7 @@ struct l2tp_packet_t *l2tp_packet_alloc(int ver, int msg_type,
struct l2tp_packet_t *pack = mempool_alloc(pack_pool);
if (!pack)
return NULL;
-
+
memset(pack, 0, sizeof(*pack));
INIT_LIST_HEAD(&pack->attrs);
pack->hdr.ver = ver;
@@ -250,16 +250,16 @@ int l2tp_recv(int fd, struct l2tp_packet_t **p, struct in_pktinfo *pkt_info,
memset(&msg, 0, sizeof(msg));
msg.msg_control = msg_control;
msg.msg_controllen = 128;
-
+
n = recvmsg(fd, &msg, MSG_PEEK);
-
+
if (n < 0) {
if (errno == EAGAIN)
return -1;
log_error("l2tp: recvmsg: %s\n", strerror(errno));
return 0;
}
-
+
for (cmsg = CMSG_FIRSTHDR(&msg); cmsg != NULL; cmsg = CMSG_NXTHDR(&msg, cmsg)) {
if (cmsg->cmsg_level == IPPROTO_IP && cmsg->cmsg_type == IP_PKTINFO) {
memcpy(pkt_info, CMSG_DATA(cmsg), sizeof(*pkt_info));