Show
Ignore:
Timestamp:
04/14/06 13:26:50 (4 years ago)
Author:
ahu
Message:

implement stunningly cool spoofing protection, plus spoofer in dnspbench

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/pdns/pdns/mtasker.cc

    r695 r699  
    159159*/ 
    160160 
    161 template<class EventKey, class EventVal>int MTasker<EventKey,EventVal>::waitEvent(const EventKey &key, EventVal *val, unsigned int timeout) 
     161template<class EventKey, class EventVal>int MTasker<EventKey,EventVal>::waitEvent(EventKey &key, EventVal *val, unsigned int timeout) 
    162162{ 
    163163  if(d_waiters.count(key)) { // there was already an exact same waiter 
     
    181181    *val=d_waitval; 
    182182  d_tid=w.tid; 
     183  key=d_eventkey; 
    183184  return d_waitstatus; 
    184185} 
     
    217218  ucontext_t *userspace=waiter->context; 
    218219  d_tid=waiter->tid;         // set tid  
    219    
     220  d_eventkey=waiter->key;        // pass waitEvent the exact key it was woken for 
    220221  d_waiters.erase(waiter);             // removes the waitpoint  
    221222  if(swapcontext(&d_kernel,userspace)) { // swaps back to the above point 'A'