~ubuntu-branches/debian/experimental/linux-2.6/experimental

« back to all changes in this revision

Viewing changes to net/batman-adv/icmp_socket.c

  • Committer: Package Import Robot
  • Author(s): maximilian attems, maximilian attems, Ben Hutchings
  • Date: 2012-06-06 10:25:57 UTC
  • mfrom: (1.2.38)
  • Revision ID: package-import@ubuntu.com-20120606102557-b9j3506wcwrqrnx8
Tags: 3.4.1-1~experimental.1
* New upstream release: http://kernelnewbies.org/Linux_3.4
* New upstream stable update:
  http://www.kernel.org/pub/linux/kernel/v3.x/ChangeLog-3.4.1

[ maximilian attems ]
* Enable DM_VERITY, NF_CONNTRACK_TIMEOUT, NF_CT_NETLINK_TIMEOUT,
  IP_NF_MATCH_RPFILTER, IP6_NF_MATCH_RPFILTER, NETFILTER_NETLINK_ACCT,
  NETFILTER_XT_MATCH_NFACCT, NET_SCH_PLUG, SCSI_UFSHCD, SCSI_VIRTIO,
  NET_TEAM, ATH6KL.

[ Ben Hutchings ]
* DFSG: Remove the new vs6624 driver, which contains non-free firmware
* aufs: Update to aufs3.4-20120521
* [rt] Update to 3.4-rt8 and reenable

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (C) 2007-2011 B.A.T.M.A.N. contributors:
 
2
 * Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
3
3
 *
4
4
 * Marek Lindner
5
5
 *
59
59
        }
60
60
 
61
61
        if (i == ARRAY_SIZE(socket_client_hash)) {
62
 
                pr_err("Error - can't add another packet client: "
63
 
                       "maximum number of clients reached\n");
 
62
                pr_err("Error - can't add another packet client: maximum number of clients reached\n");
64
63
                kfree(socket_client);
65
64
                return -EXFULL;
66
65
        }
162
161
 
163
162
        if (len < sizeof(struct icmp_packet)) {
164
163
                bat_dbg(DBG_BATMAN, bat_priv,
165
 
                        "Error - can't send packet from char device: "
166
 
                        "invalid packet size\n");
 
164
                        "Error - can't send packet from char device: invalid packet size\n");
167
165
                return -EINVAL;
168
166
        }
169
167
 
191
189
                goto free_skb;
192
190
        }
193
191
 
194
 
        if (icmp_packet->packet_type != BAT_ICMP) {
 
192
        if (icmp_packet->header.packet_type != BAT_ICMP) {
195
193
                bat_dbg(DBG_BATMAN, bat_priv,
196
 
                        "Error - can't send packet from char device: "
197
 
                        "got bogus packet type (expected: BAT_ICMP)\n");
 
194
                        "Error - can't send packet from char device: got bogus packet type (expected: BAT_ICMP)\n");
198
195
                len = -EINVAL;
199
196
                goto free_skb;
200
197
        }
201
198
 
202
199
        if (icmp_packet->msg_type != ECHO_REQUEST) {
203
200
                bat_dbg(DBG_BATMAN, bat_priv,
204
 
                        "Error - can't send packet from char device: "
205
 
                        "got bogus message type (expected: ECHO_REQUEST)\n");
 
201
                        "Error - can't send packet from char device: got bogus message type (expected: ECHO_REQUEST)\n");
206
202
                len = -EINVAL;
207
203
                goto free_skb;
208
204
        }
209
205
 
210
206
        icmp_packet->uid = socket_client->index;
211
207
 
212
 
        if (icmp_packet->version != COMPAT_VERSION) {
 
208
        if (icmp_packet->header.version != COMPAT_VERSION) {
213
209
                icmp_packet->msg_type = PARAMETER_PROBLEM;
214
 
                icmp_packet->version = COMPAT_VERSION;
 
210
                icmp_packet->header.version = COMPAT_VERSION;
215
211
                bat_socket_add_packet(socket_client, icmp_packet, packet_len);
216
212
                goto free_skb;
217
213
        }