From: Hangbin Liu <liuhangbin@gmail.com>
To: Daniel Borkmann <dborkman@redhat.com>
Cc: Trinity <trinity@vger.kernel.org>
Subject: Re: [PATCH] net: add ipv4/ipv6 sctp support
Date: Sat, 26 Jul 2014 10:51:14 +0800 [thread overview]
Message-ID: <CAPwn2JSbfzzU+wGmQvFeE8P6QJdGSnExqvChGtyAjSRgbsxB6Q@mail.gmail.com> (raw)
In-Reply-To: <53D22DBF.20701@redhat.com>
2014-07-25 18:13 GMT+08:00 Daniel Borkmann <dborkman@redhat.com>:
> Hi Hangbin,
>
>
> On 07/25/2014 06:25 AM, Hangbin Liu wrote:
>>
>> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
>> ---
>> net/proto-ipv4.c | 20 ++++++++++++++------
>> net/proto-ipv6.c | 21 ++++++++++++++++-----
>> 2 files changed, 30 insertions(+), 11 deletions(-)
>>
>> diff --git a/net/proto-ipv4.c b/net/proto-ipv4.c
>> index 8babe6d..5588518 100644
>> --- a/net/proto-ipv4.c
>> +++ b/net/proto-ipv4.c
>> @@ -97,22 +97,30 @@ void ipv4_gen_sockaddr(struct sockaddr **addr,
>> socklen_t *addrlen)
>>
>> void inet_rand_socket(struct socket_triplet *st)
>> {
>> - switch (rand() % 3) {
>> - case 0: st->type = SOCK_STREAM; // TCP
>> + switch (rand() % 4) {
>> + case 0: st->type = SOCK_STREAM; // TCP/SCTP
>> + switch (rand() % 3) {
>> + case 0: st->protocol = 0; break;
>> + case 1: st->protocol = IPPROTO_TCP; break;
>> + case 2: st->protocol = IPPROTO_SCTP; break;
>> + default:break;
>> + }
>
>
> I think it would be good for readability reasons to use
> the kernel coding style convention, but I'm not sure what
> Dave's preference is as the style is also present elsewhere.
I'm OK to change the code style, wait for Dave's response.
Thanks
Hangbin Liu
prev parent reply other threads:[~2014-07-26 2:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-25 4:25 [PATCH] net: add ipv4/ipv6 sctp support Hangbin Liu
2014-07-25 10:13 ` Daniel Borkmann
2014-07-26 2:51 ` Hangbin Liu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAPwn2JSbfzzU+wGmQvFeE8P6QJdGSnExqvChGtyAjSRgbsxB6Q@mail.gmail.com \
--to=liuhangbin@gmail.com \
--cc=dborkman@redhat.com \
--cc=trinity@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).