* Re: [PATCH v4] net: fix hw_features ethtool_ops->set_flags compatibility
From: David Miller @ 2011-04-22 0:21 UTC (permalink / raw)
To: mirq-linux; +Cc: netdev, bhutchings, eric.dumazet, vladz, eilong
In-Reply-To: <20110421235921.89D1D13909@rere.qmqm.pl>
From: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Date: Fri, 22 Apr 2011 01:59:21 +0200 (CEST)
> __ethtool_set_flags() was not taking into account features set but not
> user-toggleable.
>
> Since GFLAGS returns masked dev->features, EINVAL is returned when
> passed flags differ to it, and not to wanted_features.
>
> Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
> ---
> This should be the simpler way Ben was talking about.
Applied, thanks.
^ permalink raw reply
* Re: [PATCH] ipv6: Remove hoplimit initialization to -1
From: David Miller @ 2011-04-22 0:25 UTC (permalink / raw)
To: thomas.egerer; +Cc: netdev
In-Reply-To: <4DAFF122.7010608@secunet.com>
From: Thomas Egerer <thomas.egerer@secunet.com>
Date: Thu, 21 Apr 2011 10:56:02 +0200
>
> The changes introduced with git-commit a02e4b7d missed to remove the
> hoplimit initialization. As a result, ipv6_get_mtu interprets the return
> value of dst_metric_raw (-1) as 255 and answers ping6 with this hoplimit.
> This patche removes the line such that ping6 is answered with the
> hoplimit value configured via sysctl.
>
> Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
Sorry for breaking this, patch applied.
Thanks!
^ permalink raw reply
* Re: [PATCH net-next-2.6 v4 1/5] sctp: Add Auto-ASCONF support
From: David Miller @ 2011-04-22 0:33 UTC (permalink / raw)
To: yjwei; +Cc: micchie, netdev, lksctp-developers
In-Reply-To: <4DAFB81B.8080308@cn.fujitsu.com>
Michio, please address Wei's feedback and resubmit this entire patch
set.
Thank you.
^ permalink raw reply
* Re: [PATCH] be2net: increment work_counter in be_worker
From: David Miller @ 2011-04-22 0:36 UTC (permalink / raw)
To: ivecera; +Cc: netdev, sathya.perla, subbu.seetharaman, ajit.khaparde
In-Reply-To: <1303381204-31258-1-git-send-email-ivecera@redhat.com>
From: Ivan Vecera <ivecera@redhat.com>
Date: Thu, 21 Apr 2011 12:20:04 +0200
> The commit 609ff3b adds support to display temperature of ASIC but there
> is missing increment of work_counter in be_worker. Because of this 1) the
> function be_cmd_get_die_temperature is called every 1 second instead of
> every 32 seconds 2) be_cmd_get_die_temperature is called, although it is
> not supported.
> This patch fixes this bug.
>
> Signed-off-by: Ivan Vecera <ivecera@redhat.com>
Applied to net-2.6, thank you.
^ permalink raw reply
* Re: Strange igb bug, out-of-tree driver seems to work fine.
From: Ben Greear @ 2011-04-22 3:43 UTC (permalink / raw)
To: Wyborny, Carolyn; +Cc: netdev
In-Reply-To: <EDC0E76513226749BFBC9C3FB031318F01382E2CEF@orsmsx508.amr.corp.intel.com>
On 04/21/2011 05:16 PM, Wyborny, Carolyn wrote:
>
>
>> -----Original Message-----
>> From: netdev-owner@vger.kernel.org [mailto:netdev-owner@vger.kernel.org]
>> On Behalf Of Ben Greear
>> Sent: Thursday, April 21, 2011 2:39 PM
>> To: netdev
>> Subject: Strange igb bug, out-of-tree driver seems to work fine.
>>
>> We have a 4-port NIC using the igb driver in a couple of systems,
>> and saw some strange issues (mostly rx CRC errors). We tried 2.6.34,
>> 2.6.36, and 2.6.38 based kernels and all showed issues. The NICs
>> are from two different vendors, though both use the igb driver.
>>
>> We then tried 2.6.36.3 with the out-of-tree igb-2.4.13.tar.gz
>> driver. And everything seems to run clean.
>>
>> My kernels are somewhat hacked and tainted, and this testing
>> is using my tainting module, but since changing only the driver
>> seems to fix things, it's _probably_ not my fault this time!
>>
>> I am running a small hack to make igb work better with VLANs
>> in my 2.6.36 and .38 kernel, though not in the .34. Here is the .36
>> diff:
>
> Hello,
>
> There have been recent patches for igb that I submitted that might contain the fix you found in the out-of-tree driver, although I'm not sure which one would affect rx CRC errors. Were there other symptoms? Any messages in the log? I'll look through the patches and see if there is anything obvious and get you some commit numbers to try.
There was nothing else that I noticed. If your patches are in 2.6.39-rc4+, I can try
them there perhaps?
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply
* Re: [PATCH net-next-2.6 v4 4/5] sctp: Add ASCONF operation on the single-homed host
From: Wei Yongjun @ 2011-04-22 4:00 UTC (permalink / raw)
To: Michio Honda; +Cc: netdev, lksctp-developers
In-Reply-To: <3BDA3586-6A7C-4305-9D41-F146575AC951@sfc.wide.ad.jp>
comment inline.
> SCTP can change the IP address on the single-homed host.
> In this case, the SCTP association transmits an ASCONF packet including addition of the new IP address and deletion of the old address. This patch implements this functionality.
> In this case, the ASCONF chunk is added to the beginning of the queue, because the other chunks cannot be transmitted in this state.
>
> Signed-off-by: Michio Honda <micchie@sfc.wide.ad.jp>
> ---
> diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h
> index c70d8cc..d7a4ee3 100644
> --- a/include/net/sctp/constants.h
> +++ b/include/net/sctp/constants.h
> @@ -441,4 +441,8 @@ enum {
> */
> #define SCTP_AUTH_RANDOM_LENGTH 32
>
> +/* ASCONF PARAMETERS */
> +#define SCTP_ASCONF_V4_PARAM_LEN 16
> +#define SCTP_ASCONF_V6_PARAM_LEN 28
> +
> #endif /* __sctp_constants_h__ */
> diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h
> index 9352d12..498a3cf 100644
> --- a/include/net/sctp/sm.h
> +++ b/include/net/sctp/sm.h
> @@ -259,6 +259,7 @@ struct sctp_chunk *sctp_process_asconf(struct sctp_association *asoc,
> struct sctp_chunk *asconf);
> int sctp_process_asconf_ack(struct sctp_association *asoc,
> struct sctp_chunk *asconf_ack);
> +void sctp_path_check_and_react(struct sctp_association *, struct sockaddr *);
> struct sctp_chunk *sctp_make_fwdtsn(const struct sctp_association *asoc,
> __u32 new_cum_tsn, size_t nstreams,
> struct sctp_fwdtsn_skip *skiplist);
> diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
> index cc9185c..400ee8a 100644
> --- a/include/net/sctp/structs.h
> +++ b/include/net/sctp/structs.h
> @@ -1901,6 +1901,9 @@ struct sctp_association {
> * after reaching 4294967295.
> */
> __u32 addip_serial;
> + union sctp_addr *asconf_addr_del_pending;
> + __u32 asconf_del_pending_cid;
useless define for 'asconf_del_pending_cid'.
> + int src_out_of_asoc_ok;
>
> /* SCTP AUTH: list of the endpoint shared keys. These
> * keys are provided out of band by the user applicaton
> diff --git a/net/sctp/associola.c b/net/sctp/associola.c
> index 6b04287..6b19387 100644
> --- a/net/sctp/associola.c
> +++ b/net/sctp/associola.c
> @@ -279,6 +279,9 @@ static struct sctp_association *sctp_association_init(struct sctp_association *a
> asoc->peer.asconf_capable = 0;
> if (sctp_addip_noauth)
> asoc->peer.asconf_capable = 1;
> + asoc->asconf_addr_del_pending = NULL;
> + asoc->asconf_del_pending_cid = 0;
> + asoc->src_out_of_asoc_ok = 0;
>
> /* Create an input queue. */
> sctp_inq_init(&asoc->base.inqueue);
> @@ -443,6 +446,10 @@ void sctp_association_free(struct sctp_association *asoc)
>
> asoc->peer.transport_count = 0;
>
> + /* Free pending address space being deleted */
> + if (asoc->asconf_addr_del_pending != NULL)
> + kfree(asoc->asconf_addr_del_pending);
> +
> /* Free any cached ASCONF_ACK chunk. */
> sctp_assoc_free_asconf_acks(asoc);
>
> diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
> index 865ce7b..56c97ce 100644
> --- a/net/sctp/ipv6.c
> +++ b/net/sctp/ipv6.c
> @@ -332,6 +332,13 @@ static void sctp_v6_get_saddr(struct sctp_sock *sk,
> matchlen = bmatchlen;
> }
> }
> + if (laddr->state == SCTP_ADDR_NEW && asoc->src_out_of_asoc_ok) {
> + bmatchlen = sctp_v6_addr_match_len(daddr, &laddr->a);
> + if (!baddr || (matchlen < bmatchlen)) {
> + baddr = &laddr->a;
> + matchlen = bmatchlen;
> + }
> + }
> }
>
> if (baddr) {
> diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c
> index 26dc005..033ea20 100644
> --- a/net/sctp/outqueue.c
> +++ b/net/sctp/outqueue.c
> @@ -344,7 +344,14 @@ int sctp_outq_tail(struct sctp_outq *q, struct sctp_chunk *chunk)
> break;
> }
> } else {
> - list_add_tail(&chunk->list, &q->control_chunk_list);
> + /* We add the ASCONF for the only one newly added address at
> + * the front of the queue
> + */
> + if (q->asoc->src_out_of_asoc_ok && \
> + chunk->chunk_hdr->type == SCTP_CID_ASCONF)
> + list_add(&chunk->list, &q->control_chunk_list);
> + else
> + list_add_tail(&chunk->list, &q->control_chunk_list);
sctp_outq_tail mean add to the tail, right?
> SCTP_INC_STATS(SCTP_MIB_OUTCTRLCHUNKS);
> }
>
> @@ -850,6 +857,24 @@ static int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout)
> case SCTP_CID_SHUTDOWN:
> case SCTP_CID_ECN_ECNE:
> case SCTP_CID_ASCONF:
> + /* RFC 5061, 5.3
> + * F1) This means that until such time as the ASCONF
> + * containing the add is acknowledged, the sender MUST
> + * NOT use the new IP address as a source for ANY SCTP
> + * packet except on carrying an ASCONF Chunk.
> + */
> + if (asoc->src_out_of_asoc_ok) {
> + SCTP_DEBUG_PRINTK("outq_flush: out_of_asoc_ok, transmit chunk type %d\n",
> + chunk->chunk_hdr->type);
> + packet = &transport->packet;
> + sctp_packet_config(packet, vtag,
> + asoc->peer.ecn_capable);
> + sctp_packet_append_chunk(packet, chunk);
> + error = sctp_packet_transmit(packet);
> + if (error < 0)
> + return error;
> + goto sctp_flush_out;
> + }
> case SCTP_CID_FWD_TSN:
> status = sctp_packet_transmit_chunk(packet, chunk,
> one_packet);
Since the sender MUST NOT use the new IP address as a source for ANY SCTP
packet except on carrying an ASCONF Chunk. And ASCONF chunk can be bundled.
How about this change. If so, you do not need change to sctp_outq_tail();
diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c
index 1c88c89..bd6cc9c 100644
--- a/net/sctp/outqueue.c
+++ b/net/sctp/outqueue.c
@@ -754,6 +754,13 @@ static int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout)
*/
list_for_each_entry_safe(chunk, tmp, &q->control_chunk_list, list) {
+ /* RFC 5061, 5.3
+ * F1) This ...
+ */
+ if (q->asoc->src_out_of_asoc_ok &&
+ chunk->chunk_hdr->type != SCTP_CID_ASCONF)
+ continue;
+
list_del_init(&chunk->list);
/* Pick the right transport to use. */
@@ -881,6 +888,9 @@ static int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout)
}
}
+ if (q->asoc->src_out_of_asoc_ok)
+ goto sctp_flush_out;
+
/* Is it OK to send data chunks? */
switch (asoc->state) {
case SCTP_STATE_COOKIE_ECHOED:
> diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
> index 152976e..b8ec3cc 100644
> --- a/net/sctp/protocol.c
> +++ b/net/sctp/protocol.c
> @@ -510,7 +510,8 @@ static struct dst_entry *sctp_v4_get_dst(struct sctp_association *asoc,
> sctp_v4_dst_saddr(&dst_saddr, dst, htons(bp->port));
> rcu_read_lock();
> list_for_each_entry_rcu(laddr, &bp->address_list, list) {
> - if (!laddr->valid || (laddr->state != SCTP_ADDR_SRC))
> + if (!laddr->valid || (laddr->state != SCTP_ADDR_SRC &&
> + asoc->src_out_of_asoc_ok == 0))
It shoud be:
if (!laddr->valid || (laddr->state == SCTP_ADDR_DEL) ||
laddr->state != SCTP_ADDR_SRC && !asoc->src_out_of_asoc_ok)
continue;
> continue;
> if (sctp_v4_cmp_addr(&dst_saddr, &laddr->a))
> goto out_unlock;
> diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
> index de98665..581a9f5 100644
> --- a/net/sctp/sm_make_chunk.c
> +++ b/net/sctp/sm_make_chunk.c
> @@ -2651,6 +2651,61 @@ __u32 sctp_generate_tsn(const struct sctp_endpoint *ep)
> return retval;
> }
>
> +void
> +sctp_path_check_and_react(struct sctp_association *asoc, struct sockaddr *sa)
> +{
> + struct sctp_transport *trans;
> + int addrnum, family;
> + struct sctp_sockaddr_entry *saddr;
> + struct sctp_bind_addr *bp;
> + union sctp_addr *tmpaddr;
> +
> + family = sa->sa_family;
> + bp = &asoc->base.bind_addr;
> + addrnum = 0;
> + /* count up the number of local addresses in the same family */
> + list_for_each_entry(saddr, &bp->address_list, list) {
> + if (saddr->a.sa.sa_family == family) {
> + tmpaddr = &saddr->a;
> + if (family == AF_INET6 &&
> + ipv6_addr_type(&tmpaddr->v6.sin6_addr) &
> + IPV6_ADDR_LINKLOCAL) {
> + continue;
> + }
> + addrnum++;
> + }
> + }
> + if (addrnum == 1) {
> + union sctp_addr *tmpaddr;
> + tmpaddr = (union sctp_addr *)sa;
> + SCTP_DEBUG_PRINTK_IPADDR("pcheck_react: only 1 local addr in asoc %p ",
> + " family %d\n", asoc, tmpaddr, family);
> + list_for_each_entry(trans, &asoc->peer.transport_addr_list,
> + transports) {
> + /* reset path information and release refcount to the
> + * dst_entry based on the src change */
> + sctp_transport_hold(trans);
> + trans->cwnd = min(4*asoc->pathmtu,
> + max_t(__u32, 2*asoc->pathmtu, 4380));
> + trans->ssthresh = asoc->peer.i.a_rwnd;
> + trans->rtt = 0;
> + trans->srtt = 0;
> + trans->rttvar = 0;
> + trans->rto = asoc->rto_initial;
> + dst_release(trans->dst);
> + trans->dst = NULL;
> + memset(&trans->saddr, 0, sizeof(union sctp_addr));
> + sctp_transport_route(trans, NULL,
> + sctp_sk(asoc->base.sk));
> + SCTP_DEBUG_PRINTK_IPADDR("we freed dst_entry (asoc: %p dst: ",
> + " trans: %p)\n", asoc, (&trans->ipaddr), trans);
> + trans->rto_pending = 1;
> + sctp_transport_put(trans);
> + }
> + }
> + return;
> +}
> +
> /*
> * ADDIP 3.1.1 Address Configuration Change Chunk (ASCONF)
> * 0 1 2 3
> @@ -2744,11 +2799,24 @@ struct sctp_chunk *sctp_make_asconf_update_ip(struct sctp_association *asoc,
> int addr_param_len = 0;
> int totallen = 0;
> int i;
> + sctp_addip_param_t del_param; /* 8 Bytes (Type 0xC002, Len and CrrID) */
> + struct sctp_af *del_af;
> + int del_addr_param_len = 0;
> + int del_paramlen = sizeof(sctp_addip_param_t);
> + union sctp_addr_param del_addr_param; /* (v4) 8 Bytes, (v6) 20 Bytes */
> + int v4 = 0;
> + int v6 = 0;
you can reuse the af, param_len etc, no need to define new variables.
>
> /* Get total length of all the address parameters. */
> addr_buf = addrs;
> for (i = 0; i < addrcnt; i++) {
> addr = (union sctp_addr *)addr_buf;
> + if (addr != NULL) {
> + if (addr->sa.sa_family == AF_INET)
> + v4 = 1;
> + else if (addr->sa.sa_family == AF_INET6)
> + v6 = 1;
> + }
> af = sctp_get_af_specific(addr->v4.sin_family);
> addr_param_len = af->to_addr_param(addr, &addr_param);
>
> @@ -2757,6 +2825,24 @@ struct sctp_chunk *sctp_make_asconf_update_ip(struct sctp_association *asoc,
>
> addr_buf += af->sockaddr_len;
> }
> + /* Add the length of a pending address being deleted */
> + if (flags == SCTP_PARAM_ADD_IP && asoc->asconf_addr_del_pending) {
> + if ((asoc->asconf_addr_del_pending->sa.sa_family == AF_INET
> + && v4) ||
> + (asoc->asconf_addr_del_pending->sa.sa_family == AF_INET6
> + && v6)) {
This check is not need. instead, you should check whether the address
is support by peer, before add this address to the asoc.
> + del_af = sctp_get_af_specific(
> + asoc->asconf_addr_del_pending->sa.sa_family);
> + del_addr_param_len = del_af->to_addr_param(
> + asoc->asconf_addr_del_pending, &del_addr_param);
> + totallen += del_paramlen;
> + totallen += del_addr_param_len;
> + SCTP_DEBUG_PRINTK("mkasconf_update_ip: now we picked del_pending addr, totallen for all addresses is %d\n",
> + totallen);
> + }
> + }
> + SCTP_DEBUG_PRINTK("mkasconf_update_ip: call mkasconf() for %d bytes\n",
> + totallen);
>
> /* Create an asconf chunk with the required length. */
> retval = sctp_make_asconf(asoc, laddr, totallen);
> @@ -2778,6 +2864,20 @@ struct sctp_chunk *sctp_make_asconf_update_ip(struct sctp_association *asoc,
>
> addr_buf += af->sockaddr_len;
> }
> + if (flags == SCTP_PARAM_ADD_IP && asoc->asconf_addr_del_pending) {
> + addr = asoc->asconf_addr_del_pending;
> + del_af = sctp_get_af_specific(addr->v4.sin_family);
> + del_addr_param_len = del_af->to_addr_param(addr,
> + &del_addr_param);
> + del_param.param_hdr.type = SCTP_PARAM_DEL_IP;
> + del_param.param_hdr.length = htons(del_paramlen +
> + del_addr_param_len);
> + del_param.crr_id = i;
> + asoc->asconf_del_pending_cid = i;
> +
> + sctp_addto_chunk(retval, del_paramlen, &del_param);
> + sctp_addto_chunk(retval, del_addr_param_len, &del_addr_param);
> + }
> return retval;
> }
>
> @@ -3193,16 +3293,37 @@ static void (struct sctp_association *asoc,
> local_bh_enable();
> list_for_each_entry(transport, &asoc->peer.transport_addr_list,
> transports) {
> - if (transport->state == SCTP_ACTIVE)
> + if (transport->state == SCTP_ACTIVE &&
> + !asoc->src_out_of_asoc_ok)
> continue;
> dst_release(transport->dst);
> sctp_transport_route(transport, NULL,
> sctp_sk(asoc->base.sk));
> }
> + asoc->src_out_of_asoc_ok = 0;
> break;
> case SCTP_PARAM_DEL_IP:
> local_bh_disable();
> sctp_del_bind_addr(bp, &addr);
> + if (asoc->asconf_addr_del_pending != NULL) {
> + if ((addr.sa.sa_family == AF_INET) &&
> + (asoc->asconf_addr_del_pending->sa.sa_family ==
> + AF_INET)) {
> + if (asoc->asconf_addr_del_pending->v4.sin_addr.s_addr == addr.v4.sin_addr.s_addr) {
> + kfree(asoc->asconf_addr_del_pending);
> + asoc->asconf_del_pending_cid = 0;
> + asoc->asconf_addr_del_pending = NULL;
> + }
> + } else if ((addr.sa.sa_family == AF_INET6) &&
> + (asoc->asconf_addr_del_pending->sa.sa_family ==
> + AF_INET6)) {
> + if (ipv6_addr_equal(&asoc->asconf_addr_del_pending->v6.sin6_addr, &addr.v6.sin6_addr)) {
> + kfree(asoc->asconf_addr_del_pending);
> + asoc->asconf_del_pending_cid = 0;
> + asoc->asconf_addr_del_pending = NULL;
> + }
> + }
> + }
If you set port to asoc->asconf_addr_del_pending, your can use the following codes:
if (asoc->asconf_addr_del_pending != NULL &&
sctp_cmp_addr_exact(&asoc->asconf_addr_del_pending->a, &addr))) {
kfree(asoc->asconf_addr_del_pending);
asoc->asconf_addr_del_pending = NULL;
}
> local_bh_enable();
> list_for_each_entry(transport, &asoc->peer.transport_addr_list,
> transports) {
> @@ -3293,6 +3414,8 @@ int sctp_process_asconf_ack(struct sctp_association *asoc,
> int no_err = 1;
> int retval = 0;
> __be16 err_code = SCTP_ERROR_NO_ERROR;
> + sctp_addip_param_t *first_asconf_param = NULL;
> + int first_asconf_paramlen;
>
> /* Skip the chunkhdr and addiphdr from the last asconf sent and store
> * a pointer to address parameter.
> @@ -3307,6 +3430,8 @@ int sctp_process_asconf_ack(struct sctp_association *asoc,
> length = ntohs(addr_param->v4.param_hdr.length);
> asconf_param = (sctp_addip_param_t *)((void *)addr_param + length);
> asconf_len -= length;
> + first_asconf_param = asconf_param;
> + first_asconf_paramlen = ntohs(first_asconf_param->param_hdr.length);
>
> /* ADDIP 4.1
> * A8) If there is no response(s) to specific TLV parameter(s), and no
> @@ -3361,6 +3486,35 @@ int sctp_process_asconf_ack(struct sctp_association *asoc,
> asconf_len -= length;
> }
>
> + /* When the source address obviously changes to newly added one, we
> + reset the cwnd to re-probe the path condition
Since we do not do this when the host/peer add/del ip addresses,
remain the peer's cwnd etc. to what it is maybe better.
and this is unnecessary when you just change the address of
the interface.
> + */
> + if (no_err && first_asconf_param->param_hdr.type == SCTP_PARAM_ADD_IP) {
> + if (first_asconf_paramlen == SCTP_ASCONF_V4_PARAM_LEN) {
> + struct sockaddr_in sin;
> +
> + memset(&sin, 0, sizeof(struct sockaddr_in));
> + sin.sin_family = AF_INET;
> + memcpy(&sin.sin_addr.s_addr, first_asconf_param + 1,
> + sizeof(struct in_addr));
> + sctp_path_check_and_react(asoc,
> + (struct sockaddr *)&sin);
> +
> + } else if (first_asconf_paramlen == SCTP_ASCONF_V6_PARAM_LEN) {
> + struct sockaddr_in6 sin6;
> +
> + memset(&sin6, 0, sizeof(struct sockaddr_in6));
> + sin6.sin6_family = AF_INET6;
> + memcpy(&sin6.sin6_addr, first_asconf_param + 1,
> + sizeof(struct in6_addr));
> + sctp_path_check_and_react(asoc,
> + (struct sockaddr *)&sin6);
> + } else {
> + SCTP_DEBUG_PRINTK("funny asconf_paramlen? (%d)\n",
> + first_asconf_paramlen);
> + }
> + }
> +
> /* Free the cached last sent asconf chunk. */
> list_del_init(&asconf->transmitted_list);
> sctp_chunk_free(asconf);
> diff --git a/net/sctp/socket.c b/net/sctp/socket.c
> index 3951a10..2bfe2a9 100644
> --- a/net/sctp/socket.c
> +++ b/net/sctp/socket.c
> @@ -527,6 +527,7 @@ static int sctp_send_asconf_add_ip(struct sock *sk,
> struct list_head *p;
> int i;
> int retval = 0;
> + struct sctp_transport *trans = NULL;
>
> if (!sctp_addip_enable)
> return retval;
> @@ -583,13 +584,10 @@ static int sctp_send_asconf_add_ip(struct sock *sk,
> goto out;
> }
>
> - retval = sctp_send_asconf(asoc, chunk);
> - if (retval)
> - goto out;
> -
> /* Add the new addresses to the bind address list with
> * use_as_src set to 0.
> */
> + SCTP_DEBUG_PRINTK("snd_asconf_addip: next, add_bind_addr with ADDR_NEW flag\n");
> addr_buf = addrs;
> for (i = 0; i < addrcnt; i++) {
> addr = (union sctp_addr *)addr_buf;
> @@ -599,6 +597,28 @@ static int sctp_send_asconf_add_ip(struct sock *sk,
> SCTP_ADDR_NEW, GFP_ATOMIC);
> addr_buf += af->sockaddr_len;
> }
> + list_for_each_entry(trans, &asoc->peer.transport_addr_list,
> + transports) {
> + if (asoc->asconf_addr_del_pending != NULL)
> + /* This ADDIP ASCONF piggybacks DELIP for the
> + * last address, so need to select src addr
> + * from the out_of_asoc addrs
> + */
> + asoc->src_out_of_asoc_ok = 1;
> + /* Clear the source and route cache in the path */
> + memset(&trans->saddr, 0, sizeof(union sctp_addr));
> + dst_release(trans->dst);
> + trans->cwnd = min(4*asoc->pathmtu, max_t(__u32,
> + 2*asoc->pathmtu, 4380));
> + trans->ssthresh = asoc->peer.i.a_rwnd;
> + trans->rto = asoc->rto_initial;
> + trans->rtt = 0;
> + trans->srtt = 0;
> + trans->rttvar = 0;
> + sctp_transport_route(trans, NULL,
> + sctp_sk(asoc->base.sk));
> + }
We should and have done update the route after the ASCONF
be ACKed. So it is unnecessary.
> + retval = sctp_send_asconf(asoc, chunk);
> }
>
> out:
> @@ -711,7 +731,9 @@ static int sctp_send_asconf_del_ip(struct sock *sk,
> struct sctp_sockaddr_entry *saddr;
> int i;
> int retval = 0;
> + int stored = 0;
>
> + chunk = NULL;
> if (!sctp_addip_enable)
> return retval;
>
> @@ -762,8 +784,42 @@ static int sctp_send_asconf_del_ip(struct sock *sk,
> bp = &asoc->base.bind_addr;
> laddr = sctp_find_unmatch_addr(bp, (union sctp_addr *)addrs,
> addrcnt, sp);
> - if (!laddr)
> - continue;
> + if ((laddr == NULL) && (addrcnt == 1)) {
> + union sctp_addr *sa_addr = NULL;
> +
> + if (asoc->asconf_addr_del_pending == NULL) {
> + asoc->asconf_addr_del_pending =
> + kmalloc(sizeof(union sctp_addr),
> + GFP_ATOMIC);
> + memset(asoc->asconf_addr_del_pending, 0,
> + sizeof(union sctp_addr));
> + if (addrs->sa_family == AF_INET) {
> + struct sockaddr_in *sin;
> +
> + sin = (struct sockaddr_in *)addrs;
> + asoc->asconf_addr_del_pending->v4.sin_family = AF_INET;
> + memcpy(&asoc->asconf_addr_del_pending->v4.sin_addr, &sin->sin_addr, sizeof(struct in_addr));
> + } else if (addrs->sa_family == AF_INET6) {
> + struct sockaddr_in6 *sin6;
> +
> + sin6 = (struct sockaddr_in6 *)addrs;
> + asoc->asconf_addr_del_pending->v6.sin6_family = AF_INET6;
> + memcpy(&asoc->asconf_addr_del_pending->v6.sin6_addr, &sin6->sin6_addr, sizeof(struct in6_addr));
> + }
> + sa_addr = (union sctp_addr *)addrs;
> + SCTP_DEBUG_PRINTK_IPADDR("send_asconf_del_ip: keep the last address asoc: %p ",
> + " at %p\n", asoc, sa_addr,
> + asoc->asconf_addr_del_pending);
> + stored = 1;
> + goto skip_mkasconf;
> + } else {
> + SCTP_DEBUG_PRINTK_IPADDR("send_asconf_del_ip: asoc %p, deleting last address ",
> + " is already stored at %p\n", asoc,
> + asoc->asconf_addr_del_pending,
> + asoc->asconf_addr_del_pending);
> + continue;
> + }
> + }
>
> /* We do not need RCU protection throughout this loop
> * because this is done under a socket lock from the
> @@ -776,6 +832,7 @@ static int sctp_send_asconf_del_ip(struct sock *sk,
> goto out;
> }
>
> +skip_mkasconf:
> /* Reset use_as_src flag for the addresses in the bind address
> * list that are to be deleted.
> */
> @@ -797,10 +854,16 @@ static int sctp_send_asconf_del_ip(struct sock *sk,
> list_for_each_entry(transport, &asoc->peer.transport_addr_list,
> transports) {
> dst_release(transport->dst);
> + /* Clear source address cache */
> + memset(&transport->saddr, 0, sizeof(union sctp_addr));
saddr will be filled when select the route, so it it necessary.
> sctp_transport_route(transport, NULL,
> sctp_sk(asoc->base.sk));
> }
>
> + if (stored) {
> + /* We don't need to transmit ASCONF */
> + continue;
> + }
> retval = sctp_send_asconf(asoc, chunk);
> }
> out:
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply related
* Re: [PATCH net-next-2.6 v5 5/5] sctp: Add ADD/DEL ASCONF handling at the receiver
From: Wei Yongjun @ 2011-04-22 4:05 UTC (permalink / raw)
To: Michio Honda; +Cc: netdev, lksctp-developers
In-Reply-To: <8F7C47DA-A0A2-48BE-84A7-1D073B5617AE@sfc.wide.ad.jp>
> This patch fixes the problem that the original code cannot delete the remote address where the corresponding transport is currently directed, even when the ASCONF is sent from the other address (this situation happens when the single-homed sender transmits ASCONF with ADD and DEL.)
we should apply this patch first before patch 4, so patch 5 and
patch 4 should change the order in the patchset.
> Signed-off-by: Michio Honda <micchie@sfc.wide.ad.jp>
> ---
> diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
> index de98665..a9f25d7 100644
> --- a/net/sctp/sm_make_chunk.c
> +++ b/net/sctp/sm_make_chunk.c
> @@ -2990,7 +2990,7 @@ static __be16 sctp_process_asconf_param(struct sctp_association *asoc,
> * an Error Cause TLV set to the new error code 'Request to
> * Delete Source IP Address'
> */
> - if (sctp_cmp_addr_exact(sctp_source(asconf), &addr))
> + if (sctp_cmp_addr_exact(&asconf->source, &addr))
> return SCTP_ERROR_DEL_SRC_IP;
>
> /* Section 4.2.2
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply
* Re: [PATCH net-next-2.6 v4 4/5] sctp: Add ASCONF operation on the single-homed host
From: Wei Yongjun @ 2011-04-22 4:10 UTC (permalink / raw)
To: Michio Honda; +Cc: netdev, lksctp-developers
In-Reply-To: <4DB0FD45.2050709@cn.fujitsu.com>
>
> Since the sender MUST NOT use the new IP address as a source for ANY SCTP
> packet except on carrying an ASCONF Chunk. And ASCONF chunk can be bundled.
> How about this change. If so, you do not need change to sctp_outq_tail();
>
> diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c
> index 1c88c89..bd6cc9c 100644
> --- a/net/sctp/outqueue.c
> +++ b/net/sctp/outqueue.c
> @@ -754,6 +754,13 @@ static int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout)
> */
>
> list_for_each_entry_safe(chunk, tmp, &q->control_chunk_list, list) {
> + /* RFC 5061, 5.3
> + * F1) This ...
> + */
> + if (q->asoc->src_out_of_asoc_ok &&
> + chunk->chunk_hdr->type != SCTP_CID_ASCONF)
SCTP_CID_ASCONF_ACK should be also allowed, the peer may
send ASCONF to do the same thing at the same time.
> + continue;
> +
> list_del_init(&chunk->list);
>
> /* Pick the right transport to use. */
> @@ -881,6 +888,9 @@ static int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout)
> }
> }
>
> + if (q->asoc->src_out_of_asoc_ok)
> + goto sctp_flush_out;
> +
> /* Is it OK to send data chunks? */
> switch (asoc->state) {
> case SCTP_STATE_COOKIE_ECHOED:
>
>
>
^ permalink raw reply
* Re: [PATCH net-next-2.6 3/3] bonding,ipv4,ipv6,vlan: Handle NETDEV_BONDING_FAILOVER like NETDEV_NOTIFY_PEERS
From: David Miller @ 2011-04-22 4:13 UTC (permalink / raw)
To: fubar; +Cc: bhutchings, andy, kaber, netdev, brian.haley
In-Reply-To: <26398.1303240321@death>
From: Jay Vosburgh <fubar@us.ibm.com>
Date: Tue, 19 Apr 2011 12:12:01 -0700
> Ben Hutchings <bhutchings@solarflare.com> wrote:
>
>>Why would we activate a slave without link up? Perhaps if the previous
>>active slave is removed?
>
> It's special sauce for Infiniband; I don't recall the details
> except that the submitter said that without it the initial gratuitous
> ARP could be lost. I didn't (and still don't) have IB hardware to test
> this on.
I vaguely remember this IB has too, but also forget the details.
If someone would get to the bottom of this and add a nice big comment
to the code, to prevent such difficulties in remembering exactly why we
do this in the future, I would very much appreciate it.
^ permalink raw reply
* Re: [PATCH] bonding: fix bridged bonds in 802.3ad mode
From: David Miller @ 2011-04-22 4:19 UTC (permalink / raw)
To: benjamin.poirier; +Cc: bhutchings, jbohac, netdev, shemminger, fubar, andy
In-Reply-To: <4DB096E0.4010407@polymtl.ca>
From: Benjamin Poirier <benjamin.poirier@polymtl.ca>
Date: Thu, 21 Apr 2011 16:43:12 -0400
> On 21/04/11 03:08 PM, Ben Hutchings wrote:
>> It seems to me that 1e253c3b8a1aeed51eef6fc366812f219b97de65 is bogus
>
> You bet, it's rubbish ;)
I've reverted it from net-2.6 and will send the revert to -stable
too.
Thanks.
^ permalink raw reply
* Re: [PATCH v5] net: bnx2x: convert to hw_features
From: Eric Dumazet @ 2011-04-22 4:51 UTC (permalink / raw)
To: Michał Mirosław; +Cc: netdev, Vladislav Zolotarov, Eilon Greenstein
In-Reply-To: <20110421224134.GB7888@rere.qmqm.pl>
Le vendredi 22 avril 2011 à 00:41 +0200, Michał Mirosław a écrit :
> On Thu, Apr 21, 2011 at 04:52:11PM +0200, Eric Dumazet wrote:
> > Le mardi 12 avril 2011 à 21:38 +0200, Michał Mirosław a écrit :
> > > Since ndo_fix_features callback is postponing features change when
> > > bp->recovery_state != BNX2X_RECOVERY_DONE, netdev_update_features()
> > > has to be called again when this condition changes. Previously,
> > > ethtool_ops->set_flags callback returned -EBUSY in that case
> > > (it's not possible in the new model).
> > >
> > > Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
> > >
> > > v5: - don't delay set_features, as it's rtnl_locked - same as recovery process
> > > v4: - complete bp->rx_csum -> NETIF_F_RXCSUM conversion
> > > - add check for failed ndo_set_features in ndo_open callback
> > > v3: - include NETIF_F_LRO in hw_features
> > > - don't call netdev_update_features() if bnx2x_nic_load() failed
> > > v2: - comment in ndo_fix_features callback
> > > ---
> > I am not sure its related to these changes, but I now have in
> > net-next-2.6 :
>
> > [ 23.674263] ------------[ cut here ]------------
> > [ 23.674266] WARNING: at net/core/dev.c:1318 dev_disable_lro+0x83/0x90()
> > [ 23.674270] Hardware name: ProLiant BL460c G6
> > [ 23.674273] Modules linked in: tg3 libphy sg
> > [ 23.674280] Pid: 3070, comm: sysctl Tainted: G W 2.6.39-rc2-01242-g3ef22b9-dirty #669
> > [ 23.674282] Call Trace:
> > [ 23.674285] [<ffffffff813b94f3>] ? dev_disable_lro+0x83/0x90
> > [ 23.674291] [<ffffffff81042c9b>] warn_slowpath_common+0x8b/0xc0
> > [ 23.674298] [<ffffffff81042ce5>] warn_slowpath_null+0x15/0x20
> > [ 23.674304] [<ffffffff813b94f3>] dev_disable_lro+0x83/0x90
> > [ 23.674309] [<ffffffff81429789>] devinet_sysctl_forward+0x199/0x210
> [...]
>
> Hmm. Looks like something is not allowing to disable LRO. Please check with
> following patch so we can be sure which driver causes this.
>
> Best Regards,
> Michał Mirosław
Yes, obviously, and I suggested roughly the same patch some time ago.
^ permalink raw reply
* Re: [PATCH] net: make WARN_ON in dev_disable_lro() useful
From: Eric Dumazet @ 2011-04-22 5:11 UTC (permalink / raw)
To: Michał Mirosław; +Cc: netdev
In-Reply-To: <20110421224215.9B8AC13909@rere.qmqm.pl>
Le vendredi 22 avril 2011 à 00:42 +0200, Michał Mirosław a écrit :
> Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
> ---
> net/core/dev.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/net/core/dev.c b/net/core/dev.c
> index 3871bf6..3421184 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -1315,7 +1315,8 @@ void dev_disable_lro(struct net_device *dev)
> return;
>
> __ethtool_set_flags(dev, flags & ~ETH_FLAG_LRO);
> - WARN_ON(dev->features & NETIF_F_LRO);
> + if (unlikely(dev->features & NETIF_F_LRO))
> + netdev_WARN(dev, "failed to disable LRO!\n");
> }
> EXPORT_SYMBOL(dev_disable_lro);
>
Yes, as suggested one month ago
http://permalink.gmane.org/gmane.linux.network/189951
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
BTW, using unlikely() or likely() in slowpath is not exactly useful,
unless its integrated in macro (WARN_... )
^ permalink raw reply
* Re: [PATCH v4] net: fix hw_features ethtool_ops->set_flags compatibility
From: Eric Dumazet @ 2011-04-22 5:16 UTC (permalink / raw)
To: Michał Mirosław
Cc: netdev, Ben Hutchings, Vladislav Zolotarov, Eilon Greenstein
In-Reply-To: <20110421235921.89D1D13909@rere.qmqm.pl>
Le vendredi 22 avril 2011 à 01:59 +0200, Michał Mirosław a écrit :
> __ethtool_set_flags() was not taking into account features set but not
> user-toggleable.
>
> Since GFLAGS returns masked dev->features, EINVAL is returned when
> passed flags differ to it, and not to wanted_features.
>
> Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
> ---
> This should be the simpler way Ben was talking about.
>
> net/core/ethtool.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/net/core/ethtool.c b/net/core/ethtool.c
> index 13d79f5..d8b1a8d 100644
> --- a/net/core/ethtool.c
> +++ b/net/core/ethtool.c
> @@ -546,12 +546,12 @@ int __ethtool_set_flags(struct net_device *dev, u32 data)
> }
>
> /* allow changing only bits set in hw_features */
> - changed = (data ^ dev->wanted_features) & flags_dup_features;
> + changed = (data ^ dev->features) & flags_dup_features;
> if (changed & ~dev->hw_features)
> return (changed & dev->hw_features) ? -EINVAL : -EOPNOTSUPP;
>
> dev->wanted_features =
> - (dev->wanted_features & ~changed) | data;
> + (dev->wanted_features & ~changed) | (data & dev->hw_features);
>
> __netdev_update_features(dev);
>
Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
Tested-by: Eric Dumazet <eric.dumazet@gmail.com>
Thanks, this solves the bnx2x problem !
^ permalink raw reply
* Re: [PATCH v4] net: fix hw_features ethtool_ops->set_flags compatibility
From: Eric Dumazet @ 2011-04-22 5:27 UTC (permalink / raw)
To: Michał Mirosław
Cc: netdev, Ben Hutchings, Vladislav Zolotarov, Eilon Greenstein
In-Reply-To: <1303449402.13893.6.camel@edumazet-laptop>
Le vendredi 22 avril 2011 à 07:16 +0200, Eric Dumazet a écrit :
> Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
> Tested-by: Eric Dumazet <eric.dumazet@gmail.com>
>
> Thanks, this solves the bnx2x problem !
>
And already in net-next-2.6 ;)
^ permalink raw reply
* Re: [PATCH] netfilter/IPv6: fix DSCP mangle code
From: David Miller @ 2011-04-22 7:08 UTC (permalink / raw)
To: fernando; +Cc: netdev, yoshfuji, jengelh, netfilter-devel
In-Reply-To: <1303455759.2023.39.camel@nausicaa>
From: Fernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>
Date: Fri, 22 Apr 2011 16:02:39 +0900
> The mask indicates the bits one wants to zero out, so it needs to be
> inverted before applying to the original TOS field.
>
> Signed-off-by: Fernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>
> ---
Netfilter patches should be sent to the netfilter developer
list, CC:'d
> diff -urNp linux-2.6.37-orig/net/netfilter/xt_DSCP.c linux-2.6.37/net/netfilter/xt_DSCP.c
> --- linux-2.6.37-orig/net/netfilter/xt_DSCP.c 2011-01-05 09:50:19.000000000 +0900
> +++ linux-2.6.37/net/netfilter/xt_DSCP.c 2011-04-21 16:01:25.801890733 +0900
> @@ -99,7 +99,7 @@ tos_tg6(struct sk_buff *skb, const struc
> u_int8_t orig, nv;
>
> orig = ipv6_get_dsfield(iph);
> - nv = (orig & info->tos_mask) ^ info->tos_value;
> + nv = (orig & ~info->tos_mask) ^ info->tos_value;
>
> if (orig != nv) {
> if (!skb_make_writable(skb, sizeof(struct iphdr)))
>
>
^ permalink raw reply
* [PATCH] netfilter/IPv6: initialize TOS field in REJECT target module
From: Fernando Luis Vazquez Cao @ 2011-04-22 7:19 UTC (permalink / raw)
To: netfilter-devel; +Cc: netdev, yoshfuji, jengelh, davem
In-Reply-To: <1303455759.2023.39.camel@nausicaa>
The IPv6 header is not zeroed out in alloc_skb so we must initialize it
properly unless we want to see IPv6 packets with random TOS fields
floating around. The current implementation resets the flow label
but this could be changed if deemed necessary.
We stumbled upon this issue when trying to apply a mangle rule to
the RST packet generated by the REJECT target module.
Signed-off-by: Fernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>
---
diff -urNp linux-2.6.38.4-orig/net/ipv6/netfilter/ip6t_REJECT.c linux-2.6.38.4/net/ipv6/netfilter/ip6t_REJECT.c
--- linux-2.6.38.4-orig/net/ipv6/netfilter/ip6t_REJECT.c 2011-03-15 10:20:32.000000000 +0900
+++ linux-2.6.38.4/net/ipv6/netfilter/ip6t_REJECT.c 2011-04-22 15:00:30.695373543 +0900
@@ -45,6 +45,8 @@ static void send_reset(struct net *net,
int tcphoff, needs_ack;
const struct ipv6hdr *oip6h = ipv6_hdr(oldskb);
struct ipv6hdr *ip6h;
+#define DEFAULT_TOS_VALUE 0x0U
+ const __u8 tclass = DEFAULT_TOS_VALUE;
struct dst_entry *dst = NULL;
u8 proto;
struct flowi fl;
@@ -123,7 +125,7 @@ static void send_reset(struct net *net,
skb_put(nskb, sizeof(struct ipv6hdr));
skb_reset_network_header(nskb);
ip6h = ipv6_hdr(nskb);
- ip6h->version = 6;
+ *(__be32 *)ip6h = htonl(0x60000000 | (tclass << 20));
ip6h->hop_limit = ip6_dst_hoplimit(dst);
ip6h->nexthdr = IPPROTO_TCP;
ipv6_addr_copy(&ip6h->saddr, &oip6h->daddr);
^ permalink raw reply
* [PATCH] netfilter/IPv6: fix DSCP mangle code
From: Fernando Luis Vazquez Cao @ 2011-04-22 7:02 UTC (permalink / raw)
To: netdev; +Cc: davem, yoshfuji, jengelh
The mask indicates the bits one wants to zero out, so it needs to be
inverted before applying to the original TOS field.
Signed-off-by: Fernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>
---
diff -urNp linux-2.6.37-orig/net/netfilter/xt_DSCP.c linux-2.6.37/net/netfilter/xt_DSCP.c
--- linux-2.6.37-orig/net/netfilter/xt_DSCP.c 2011-01-05 09:50:19.000000000 +0900
+++ linux-2.6.37/net/netfilter/xt_DSCP.c 2011-04-21 16:01:25.801890733 +0900
@@ -99,7 +99,7 @@ tos_tg6(struct sk_buff *skb, const struc
u_int8_t orig, nv;
orig = ipv6_get_dsfield(iph);
- nv = (orig & info->tos_mask) ^ info->tos_value;
+ nv = (orig & ~info->tos_mask) ^ info->tos_value;
if (orig != nv) {
if (!skb_make_writable(skb, sizeof(struct iphdr)))
^ permalink raw reply
* Re: [PATCH] netfilter/IPv6: fix DSCP mangle code
From: Fernando Luis Vazquez Cao @ 2011-04-22 7:29 UTC (permalink / raw)
To: David Miller; +Cc: netdev, yoshfuji, jengelh, netfilter-devel
In-Reply-To: <20110422.000838.193727308.davem@davemloft.net>
On Fri, 2011-04-22 at 00:08 -0700, David Miller wrote:
> From: Fernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>
> Date: Fri, 22 Apr 2011 16:02:39 +0900
>
> > The mask indicates the bits one wants to zero out, so it needs to be
> > inverted before applying to the original TOS field.
> >
> > Signed-off-by: Fernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>
> > ---
>
> Netfilter patches should be sent to the netfilter developer
> list, CC:'d
Thank you for the heads-up, David.
By the way, I have just sent one more patch that fixes what I think is
another netfilter bug. If everyone is ok with these two patches it would
be great if we could get them merged for the next -rc release (we hit
these bugs in our production systems).
Regards,
Fernando
^ permalink raw reply
* Re: [PATCH] netfilter/IPv6: initialize TOS field in REJECT target module
From: Eric Dumazet @ 2011-04-22 7:34 UTC (permalink / raw)
To: Fernando Luis Vazquez Cao
Cc: netfilter-devel, netdev, yoshfuji, jengelh, davem
In-Reply-To: <1303456743.2023.55.camel@nausicaa>
Le vendredi 22 avril 2011 à 16:19 +0900, Fernando Luis Vazquez Cao a
écrit :
> The IPv6 header is not zeroed out in alloc_skb so we must initialize it
> properly unless we want to see IPv6 packets with random TOS fields
> floating around. The current implementation resets the flow label
> but this could be changed if deemed necessary.
>
> We stumbled upon this issue when trying to apply a mangle rule to
> the RST packet generated by the REJECT target module.
>
> Signed-off-by: Fernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>
> ---
>
> diff -urNp linux-2.6.38.4-orig/net/ipv6/netfilter/ip6t_REJECT.c linux-2.6.38.4/net/ipv6/netfilter/ip6t_REJECT.c
> --- linux-2.6.38.4-orig/net/ipv6/netfilter/ip6t_REJECT.c 2011-03-15 10:20:32.000000000 +0900
> +++ linux-2.6.38.4/net/ipv6/netfilter/ip6t_REJECT.c 2011-04-22 15:00:30.695373543 +0900
> @@ -45,6 +45,8 @@ static void send_reset(struct net *net,
> int tcphoff, needs_ack;
> const struct ipv6hdr *oip6h = ipv6_hdr(oldskb);
> struct ipv6hdr *ip6h;
> +#define DEFAULT_TOS_VALUE 0x0U
> + const __u8 tclass = DEFAULT_TOS_VALUE;
> struct dst_entry *dst = NULL;
> u8 proto;
> struct flowi fl;
> @@ -123,7 +125,7 @@ static void send_reset(struct net *net,
> skb_put(nskb, sizeof(struct ipv6hdr));
> skb_reset_network_header(nskb);
> ip6h = ipv6_hdr(nskb);
> - ip6h->version = 6;
> + *(__be32 *)ip6h = htonl(0x60000000 | (tclass << 20));
It seems fine but I am wondering where is payload_len set ?
^ permalink raw reply
* Re: [PATCH] netfilter/IPv6: initialize TOS field in REJECT target module
From: Fernando Luis Vazquez Cao @ 2011-04-22 7:47 UTC (permalink / raw)
To: Eric Dumazet; +Cc: netfilter-devel, netdev, yoshfuji, jengelh, davem
In-Reply-To: <1303457656.3134.12.camel@edumazet-laptop>
On Fri, 2011-04-22 at 09:34 +0200, Eric Dumazet wrote:
> Le vendredi 22 avril 2011 à 16:19 +0900, Fernando Luis Vazquez Cao a
> écrit :
> > The IPv6 header is not zeroed out in alloc_skb so we must initialize it
> > properly unless we want to see IPv6 packets with random TOS fields
> > floating around. The current implementation resets the flow label
> > but this could be changed if deemed necessary.
> >
> > We stumbled upon this issue when trying to apply a mangle rule to
> > the RST packet generated by the REJECT target module.
> >
> > Signed-off-by: Fernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>
> > ---
> >
> > diff -urNp linux-2.6.38.4-orig/net/ipv6/netfilter/ip6t_REJECT.c linux-2.6.38.4/net/ipv6/netfilter/ip6t_REJECT.c
> > --- linux-2.6.38.4-orig/net/ipv6/netfilter/ip6t_REJECT.c 2011-03-15 10:20:32.000000000 +0900
> > +++ linux-2.6.38.4/net/ipv6/netfilter/ip6t_REJECT.c 2011-04-22 15:00:30.695373543 +0900
> > @@ -45,6 +45,8 @@ static void send_reset(struct net *net,
> > int tcphoff, needs_ack;
> > const struct ipv6hdr *oip6h = ipv6_hdr(oldskb);
> > struct ipv6hdr *ip6h;
> > +#define DEFAULT_TOS_VALUE 0x0U
> > + const __u8 tclass = DEFAULT_TOS_VALUE;
> > struct dst_entry *dst = NULL;
> > u8 proto;
> > struct flowi fl;
> > @@ -123,7 +125,7 @@ static void send_reset(struct net *net,
> > skb_put(nskb, sizeof(struct ipv6hdr));
> > skb_reset_network_header(nskb);
> > ip6h = ipv6_hdr(nskb);
> > - ip6h->version = 6;
> > + *(__be32 *)ip6h = htonl(0x60000000 | (tclass << 20));
>
> It seems fine but I am wondering where is payload_len set ?
Hi Eric,
Thank you for the review, I really appreciate it.
payload_len is set in __ip6_local_out() which is called from
ip6_local_out.
Could I get your acked-by for the two patches I sent?
Thanks,
Fernando
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH] netfilter/IPv6: initialize TOS field in REJECT target module
From: Eric Dumazet @ 2011-04-22 8:06 UTC (permalink / raw)
To: Fernando Luis Vazquez Cao
Cc: netfilter-devel, netdev, yoshfuji, jengelh, davem
In-Reply-To: <1303458454.9791.13.camel@nausicaa>
Le vendredi 22 avril 2011 à 16:47 +0900, Fernando Luis Vazquez Cao a
écrit :
> Hi Eric,
>
> Thank you for the review, I really appreciate it.
>
> payload_len is set in __ip6_local_out() which is called from
> ip6_local_out.
>
Thats right, thanks !
> Could I get your acked-by for the two patches I sent?
>
Sure
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH] netfilter/IPv6: initialize TOS field in REJECT target module
From: Fernando Luis Vazquez Cao @ 2011-04-22 8:11 UTC (permalink / raw)
To: Eric Dumazet; +Cc: netfilter-devel, netdev, yoshfuji, jengelh, davem
In-Reply-To: <1303459560.3134.14.camel@edumazet-laptop>
On Fri, 2011-04-22 at 10:06 +0200, Eric Dumazet wrote:
> Le vendredi 22 avril 2011 à 16:47 +0900, Fernando Luis Vazquez Cao a
> écrit :
> > Could I get your acked-by for the two patches I sent?
> >
>
> Sure
>
> Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Thank you!
Should we send these two patches to -stable too?
^ permalink raw reply
* Re: [PATCH] netfilter/IPv6: initialize TOS field in REJECT target module
From: Eric Dumazet @ 2011-04-22 8:37 UTC (permalink / raw)
To: Fernando Luis Vazquez Cao
Cc: netfilter-devel, netdev, yoshfuji, jengelh, davem
In-Reply-To: <1303459875.9791.19.camel@nausicaa>
Le vendredi 22 avril 2011 à 17:11 +0900, Fernando Luis Vazquez Cao a
écrit :
> Thank you!
>
> Should we send these two patches to -stable too?
>
David takes care of stable submissions for netdev stuff, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH V14 4/4] ptp: Added a clock driver for the National Semiconductor PHYTER.
From: Richard Cochran @ 2011-04-22 9:21 UTC (permalink / raw)
To: Ben Hutchings
Cc: linux-kernel, linux-api, netdev, devicetree-discuss,
linux-arm-kernel, linuxppc-dev, Alan Cox, Arnd Bergmann,
Christoph Lameter, David Miller, John Stultz, Krzysztof Halasa,
Peter Zijlstra, Rodolfo Giometti, Thomas Gleixner,
Benjamin Herrenschmidt, Mike Frysinger, Paul Mackerras,
Russell King
In-Reply-To: <1303160245.2857.60.camel@bwh-desktop>
On Mon, Apr 18, 2011 at 09:57:25PM +0100, Ben Hutchings wrote:
> Would be better without the magic numbers.
Yes, of course, you are right, and also about patch #3.
Please take a look at v15 and see if it improves things.
Thanks,
Richard
^ permalink raw reply
* Re: [PATCH net-next-2.6] veth: remove unneeded ifname code from veth_newlink()
From: Michał Mirosław @ 2011-04-22 9:43 UTC (permalink / raw)
To: Jiri Pirko; +Cc: netdev, davem, xemul
In-Reply-To: <20110124154546.GA2689@psychotron.brq.redhat.com>
2011/1/24 Jiri Pirko <jpirko@redhat.com>:
> The code is not needed because tb[IFLA_IFNAME] is already
> processed in rtnl_newlink(). Remove this redundancy.
>
> Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Hi. This patch broke creation of veth devices. Reverting it fixes the issue.
Symptoms:
icybox:~# ip link add type veth
RTNETLINK answers: File exists
icybox:~# ip link add type veth peer veth1
icybox:~# ip addr
[...]
56: D: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
link/ether e6:57:58:52:03:50 brd ff:ff:ff:ff:ff:ff
57: veth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
link/ether c2:c2:a2:d5:d5:3a brd ff:ff:ff:ff:ff:ff
Best Regards,
Michał Mirosław
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).