netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Joakim Tjernlund" <joakim.tjernlund@transmode.se>
To: "'Patrick McHardy'" <kaber@trash.net>
Cc: <netdev@vger.kernel.org>
Subject: RE: how to set pppoe source mac address?
Date: Sun, 21 Oct 2007 21:05:15 +0200	[thread overview]
Message-ID: <007901c81415$50898e40$5267a8c0@Jocke> (raw)
In-Reply-To: <471B9181.8010502@trash.net>

> -----Original Message-----
> From: Patrick McHardy [mailto:kaber@trash.net] 
> Sent: den 21 oktober 2007 19:51
> To: Joakim Tjernlund
> Cc: netdev@vger.kernel.org
> Subject: Re: how to set pppoe source mac address?
> 
> Joakim Tjernlund wrote:
> > I have several pppoe i/f's over one eth i/f and I want to set the
> > source mac address used by each pppoe i/f to a unique mac 
> address from
> > user space.
> > 
> > Is this possible? If so, how do I do that?
> 
> 
> Try the macvlan driver.
> 

Thanks, but I can't see that it will help.

I am looking for something like this that I currently have added
to pppoe_ioctl() in pppoe.c: 
 
 case PPPOEIOCSSRCMAC:
        {
            struct relay_source_mac smac;

            err = -EBUSY;
            if (sk->sk_state & (PPPOX_BOUND|PPPOX_ZOMBIE|PPPOX_DEAD))
                break;

            err = -ENOTCONN;
            if (!(sk->sk_state & PPPOX_CONNECTED))
                break;

            err = -EFAULT;
            if (copy_from_user(&smac, (void *) arg, sizeof(smac)))
                break;

            memcpy(po->srcmac, smac.srcmac, ETH_ALEN);

            err = 0;
            break;
        }

then changed the call to hard_header in __pppoe_xmit() to
     dev->hard_header(skb, dev, ETH_P_PPP_SES,
                      po->pppoe_pa.remote,
                      po->srcmac, data_len);

Would a new ioctl(PPPOEIOCSSRCMAC) to pppoe be acceptable?

 Jocke


  reply	other threads:[~2007-10-21 19:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-21 13:33 how to set pppoe source mac address? Joakim Tjernlund
2007-10-21 17:50 ` Patrick McHardy
2007-10-21 19:05   ` Joakim Tjernlund [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-01-19 15:03 Joakim Tjernlund

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='007901c81415$50898e40$5267a8c0@Jocke' \
    --to=joakim.tjernlund@transmode.se \
    --cc=kaber@trash.net \
    --cc=netdev@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 NNTP newsgroup(s).