euglug.org

[작성자:] admin

  • [Eug-lug] Connection Teaming



    Bob MillerMon Jan 10 16:47:57 PST 2005

    Derald Grimwood wrote:
    
    > Hi, I'm going to guess the answer to this question is no, since I couldn't
    > find anything on the internet, but does anyone know of any Linux software
    > that supports modem/connection teaming? I know about MPPP but that really
    > won't work for me. I need to combine landline and wireless modems. Windows
    > options are Intergate and Artera Turbo that I've found.
    
    Hi, Derald.
    
    I'm not sure what "teaming" is.  If you're talking about using two
    modems to get a single virtual connection with double the bandwidth,
    you want to take a look at the EQL driver.  Start here.
    
    	/usr/src/linux/Documentation/networking/eql.txt
    
    -- 
    Bob Miller                              K<bob>
    kbobsoft software consulting
    http://kbobsoft.com                     kbob at jogger-egg.com
    
  • [Eug-lug] LP64



    Bob MillerMon Jan 10 16:38:11 PST 2005

    Jacob Meuser wrote:
    
    > the thing is, there's also a foo_open function, that returns a
    > pointer to a struct.  the code was apparently written to make
    > open and ibp_open interchangable.  since they have different
    > return types, the author chose to use (void *).  the only use
    > of data is "if(!data) { ... }".
    
    And that's wrong too.  Zero is a valid file descriptor, but not
    a valid pointer.  Never mind that if you never pass the descriptor
    to close(), you have a descriptor leak.
    
    -- 
    Bob Miller                              K<bob>
    kbobsoft software consulting
    http://kbobsoft.com                     kbob at jogger-egg.com
    
  • [Eug-lug] old /etc/ssh/ssh_host_key



    Jacob MeuserMon Jan 10 16:16:29 PST 2005

    On Mon, Jan 10, 2005 at 04:13:56PM -0800, Jacob Meuser wrote:
    
    > $ suso ssh-keygen -q -t dsa -f /etc/ssh/ssh_host_dsa_key -N
    > $ suso ssh-keygen -q -t rsa -f /etc/ssh/ssh_host_rsa_key -N
    > $ suso ssh-keygen -q -t rsa1 -f /etc/ssh/ssh_host_key -N
    
    and I can't type today either.  that should be sudo there, not
    suso.
    
    -- 
    <jakemsr at jakemsr.com>
    
  • [Eug-lug] old /etc/ssh/ssh_host_key



    Jacob MeuserMon Jan 10 16:13:56 PST 2005

    On Mon, Jan 10, 2005 at 04:06:58PM -0800, Allen Brown wrote:
    
    > Separate stop and start behave exactly the same.  It doesn't work.
    
    Oops, sorry.  I am spoiled by OpenBSD.  The /etc/rc script actually
    makes the keys.  I thought sshd did it.
    
    $ suso ssh-keygen -q -t dsa -f /etc/ssh/ssh_host_dsa_key -N
    $ suso ssh-keygen -q -t rsa -f /etc/ssh/ssh_host_rsa_key -N
    $ suso ssh-keygen -q -t rsa1 -f /etc/ssh/ssh_host_key -N
    
    -- 
    <jakemsr at jakemsr.com>
    
  • [Eug-lug] old /etc/ssh/ssh_host_key



    Allen BrownMon Jan 10 16:06:58 PST 2005

    Jacob Meuser wrote:
    > On Mon, Jan 10, 2005 at 03:41:17PM -0800, Allen Brown wrote:
    > 
    >>Jacob Meuser wrote:
    >>
    >>>On Mon, Jan 10, 2005 at 03:24:45PM -0800, Allen Brown wrote:
    >>>
    >>>
    >>>>I just noticed that my /etc/ssh/ssh_host_key is 3 years old.
    >>>>The install is not that old.  I think I should generate it.
    >>>>
    >>>>This is Debian Sarge.  Is there some nice way to do this?
    >>>>Should I just use ssh-keygen?  (I just read the man page
    >>>>and it wasn't clear what I am supposed to do.)
    >>>
    >>>
    >>>sshd will create keys on startup if they don't exist.  you can just
    >>>move your keys somewhere safe, stop and then restart sshd.
    >>
    >>I moved *keys*.  I then "/etc/init.d/ssh restart" and got:
    > 
    > 
    > restart probably sends a SIGHUP, not the same as stopping and
    > restarting.
    > 
    
    Separate stop and start behave exactly the same.  It doesn't work.
    -- 
    Allen Brown
       work: Agilent Technologies      non-work: http://www.peak.org/~abrown/
             allen_brown at agilent.com	            abrown at peak.org
       Nothing dignifies labor so much as the saving of it. --- J. Rodgers
    
  • [Eug-lug] old /etc/ssh/ssh_host_key



    Jacob MeuserMon Jan 10 15:57:12 PST 2005

    On Mon, Jan 10, 2005 at 03:41:17PM -0800, Allen Brown wrote:
    > Jacob Meuser wrote:
    > >On Mon, Jan 10, 2005 at 03:24:45PM -0800, Allen Brown wrote:
    > >
    > >>I just noticed that my /etc/ssh/ssh_host_key is 3 years old.
    > >>The install is not that old.  I think I should generate it.
    > >>
    > >>This is Debian Sarge.  Is there some nice way to do this?
    > >>Should I just use ssh-keygen?  (I just read the man page
    > >>and it wasn't clear what I am supposed to do.)
    > >
    > >
    > >sshd will create keys on startup if they don't exist.  you can just
    > >move your keys somewhere safe, stop and then restart sshd.
    > 
    > I moved *keys*.  I then "/etc/init.d/ssh restart" and got:
    
    restart probably sends a SIGHUP, not the same as stopping and
    restarting.
    
    -- 
    <jakemsr at jakemsr.com>
    
  • [Eug-lug] LP64



    Jacob MeuserMon Jan 10 15:55:20 PST 2005

    On Mon, Jan 10, 2005 at 12:30:40AM -0800, Neil Parker wrote:
    > Jacob Meuser wrote,
    > >the thing is, there's also a foo_open function, that returns a
    > >pointer to a struct.  the code was apparently written to make
    > >open and ibp_open interchangable.  since they have different
    > >return types, the author chose to use (void *).  the only use
    > >of data is "if(!data) { ... }".
    > 
    > In that case, the correct approach is probably to wrap open() with
    > something that returns a pointer.  For example,
    > 
    > #include <stdio.h>
    > #include <sys/types.h>
    > #include <sys/stat.h>
    > #include <fcntl.h>
    > #include <stdarg.h>
    > #include <stdlib.h>
    > 
    > int *wrapped_open(cont char *name, int flags, ...)
    > {
    > 	int *fdp = (int *)malloc(sizeof(int));
    > 	mode_t mode;
    > 	va_list v;
    > 
    > 	if(fdp!=(int *)NULL) {
    > 		if(flags&O_CREAT) {
    > 			va_start(v, flags);
    > 			mode = va_arg(v, mode_t);
    > 			va_end(v);
    > 			*fdp = open(name, flags, mode);
    > 		} else
    > 			*fdp = open(name, flags);
    > 	}
    > 	return fdp;
    > }
    > 
    > Then (unless I made a coding error), you can call wrapped_open() instead of
    > open(), and it will return a pointer the file descriptor instead of the
    > descriptor itself (unless you're out of memory, in which case it returns
    > NULL).  And gcc should be happy to cast the result of wrapped_open() to
    > void *.
    > 
    > Of course you'll have to free() the returned pointer after you close the
    > file.  You'll probably also have to rewrite some of the code that uses the
    > return value, since the file descriptor is now "*data" instead of
    > "(int)data".
    
    thanks, this is helpful.
    
    > I still don't understand why the original code did the cast, though.  The
    > only reason to make the returns from open() and ibp_open() interchangeable
    > is if you're planning to interchange them.  But it doesn't make sense to
    > pass your fake pointer from open() to a routine that expects ibp_open()'s
    > structure pointer, since the fake pointer doesn't actually point to the
    > right structure.
    > 
    > I suppose the routines that handle ibp_open()'s structure could be written
    > to call different code when they detect that the pointer has a nonsensical
    > value, but that strikes me as more of an ugly hack than a reasonable
    > design.
    
    there's definitely some, uh, interesting, stuff in the IBP/LoRS
    codebase.
    
    > And are you SURE that "data" is only used in lines like "if(!data) ..."?  In
    > that case, why is the code bothering to open the file at all?  The usual
    > reason for opening a file is to do some kind of I/O on it...
    
    now that I look closer, there are some reads and write associated with
    data.
    
    here's how _that_ gets setup
    
      ssize_t (*xio_read_v)(void *stream)(void *buf, size_t count);
    
    if using read()
    
      xio_read_v = (ssize_t(*)(void *, void *, size_t))&read;
    
    if using ibp_read()
    
      xio_read_v = &ibp_read;
    
    -- 
    <jakemsr at jakemsr.com>
    
  • [Eug-lug] old /etc/ssh/ssh_host_key



    Allen BrownMon Jan 10 15:41:17 PST 2005

    Jacob Meuser wrote:
    > On Mon, Jan 10, 2005 at 03:24:45PM -0800, Allen Brown wrote:
    > 
    >>I just noticed that my /etc/ssh/ssh_host_key is 3 years old.
    >>The install is not that old.  I think I should generate it.
    >>
    >>This is Debian Sarge.  Is there some nice way to do this?
    >>Should I just use ssh-keygen?  (I just read the man page
    >>and it wasn't clear what I am supposed to do.)
    > 
    > 
    > sshd will create keys on startup if they don't exist.  you can just
    > move your keys somewhere safe, stop and then restart sshd.
    
    I moved *keys*.  I then "/etc/init.d/ssh restart" and got:
    Could not load host key: /etc/ssh/ssh_host_key
    Could not load host key: /etc/ssh/ssh_host_rsa_key
    Could not load host key: /etc/ssh/ssh_host_dsa_key
    Disabling protocol version 1. Could not load host key
    Disabling protocol version 2. Could not load host key
    sshd: no hostkeys available -- exiting.
    
    So that doesn't seem to work.
    -- 
    Allen Brown
       work: Agilent Technologies      non-work: http://www.peak.org/~abrown/
             allen_brown at agilent.com	            abrown at peak.org
       Man does not live by bread alone.  He's got to have some peanut butter.
    
  • [Eug-lug] old /etc/ssh/ssh_host_key



    Jacob MeuserMon Jan 10 15:30:57 PST 2005

    On Mon, Jan 10, 2005 at 03:24:45PM -0800, Allen Brown wrote:
    > I just noticed that my /etc/ssh/ssh_host_key is 3 years old.
    > The install is not that old.  I think I should generate it.
    > 
    > This is Debian Sarge.  Is there some nice way to do this?
    > Should I just use ssh-keygen?  (I just read the man page
    > and it wasn't clear what I am supposed to do.)
    
    sshd will create keys on startup if they don't exist.  you can just
    move your keys somewhere safe, stop and then restart sshd.
    
    -- 
    <jakemsr at jakemsr.com>
    
  • [Eug-lug] old /etc/ssh/ssh_host_key



    Allen BrownMon Jan 10 15:24:45 PST 2005

    I just noticed that my /etc/ssh/ssh_host_key is 3 years old.
    The install is not that old.  I think I should generate it.
    
    This is Debian Sarge.  Is there some nice way to do this?
    Should I just use ssh-keygen?  (I just read the man page
    and it wasn't clear what I am supposed to do.)
    -- 
    Allen Brown
       work: Agilent Technologies      non-work: http://www.peak.org/~abrown/
             allen_brown at agilent.com	            abrown at peak.org
       I have always wished that my computer would be as easy to use as my
       telephone.  My wish has come true.  I no longer know how to use my
       telephone. --- Bjarne Stroustrup, CS prof, designer of C++